Professional Documents
Culture Documents
ОПМС ЛР14 kudrinskikh
ОПМС ЛР14 kudrinskikh
ОПМС ЛР14 kudrinskikh
Хід роботи
Розв’язання:
Арк.
Арк.
Лістинг програми:
Файл menuha.h:
#pragma once
void t1(); //завдання 1
void t2(); //завдання 2
void t3(); //завдання 3
void t4(); //завдання 4
void t5(); //завдання 5
void t6(); //завдання 6
void vyhod(); //вихід з програми
void trubochist(); //чистка вікна
Файл menuha.cpp:
#include<iostream>
#include<Windows.h>
#include<cstring>
#include<string.h>
#include <clocale>
#include <conio.h>
#include<algorithm>
#include <string>
Арк.
Арк.
int count = 0;
i += delimiter.length();
if (i < text.length() && text[i] == startChar) {
count++;
}
}
}
Арк.
cout << "Буква, на яку починається найменша кількість слів: " << minStartChar << endl;
}
void t6() {
string input;
cout << "Введіть рядок: ";
getline(cin, input);
int count = 0;
string lastWord;
cout << "Кількість букв 'а' в останньому слові: " << count << endl;
}
void vyhod() {
int resp;
cout << "Вы уверены, что хотите выйти из программы? (y/n)?";
resp = getchar();
if (resp == 'y' || resp == 'Y') { ochistka(1); exit(0); }
}
void trubochist() {
ochistka();
}
Файл risunokmenuji.h:
#pragma once
void narisuj(); //створення меню
void dvizhenije(int x, int y); //переміщення курсора на позицію int x, int y
void vybor(int vyb, bool active); //підсвічування пункту меню
void ochistka(int okno = 0); //очищення консольного вікна
void getCursor(void); //запам'ятовування розміщення курсору
void showCursor(bool visible); //показ курсору
Файл risunokmenuji.cpp:
#include <windows.h>
#include <conio.h>
#include <iostream>
Арк.
Арк.
SetConsoleTextAttribute(hStdOut,
woкkWindowAttributes);
showCursor(true);
switch (sel)
{
case MNUT1:
t1();
getCursor();
break;
case MNUT2:
t2();
getCursor();
break;
case MNUT3:
t3();
getCursor();
break;
case MNUT4:
t4();
getCursor();
break;
case MNUT5:
t5();
getCursor();
break;
case MNUT6:
t6();
getCursor();
break;
case MNUCHISTKA:
trubochist();
curspos = { 0, 1 };
Арк.
Арк.
Арк.
Арк.