-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathV3.cpp
63 lines (56 loc) · 1.01 KB
/
V3.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include<iostream>
#include<Windows.h>
#include<cstring>
#include <conio.h>
using namespace std;
int main()
{
system("color F0");
system("chcp 1251 >nul");
int n;
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
while (true)
{
char str[100];
char priz[100];
char im[100];
char pobat[100];
cout << "Ââåä³òü Ï.².Á." << endl;
cin.getline(str, 100);
system("cls");
int count = 0,j=0;
int first, second, thirdth;
for (int i = 0; i <= strlen(str); i++)
{
if (str[i] == 'å')
{
count++;
}
if (str[i] == ' ')
{
j++;
}
if (j == 0)
{
first = i;
}
if (j == 1)
{
second = i+1;
}
if (j == 2)
{
thirdth = i+1;
}
}
strncpy_s(priz, str, first);
strncpy_s(im, str, second);
strncpy_s(pobat, str, thirdth);
cout << priz<<" "<< im[0]<<"."<< pobat[0] << ". ìຠ" << count << " áóêâ å." << endl;
cout << "n/N - exit" << endl;
n = _getch();
if (n == 78 || n == 110 || n == 210 || n == 242) exit(0);
system("cls");
}
}