-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path7998.cpp
47 lines (43 loc) · 834 Bytes
/
7998.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
#include <iostream>
#include<string.h>
#include <stdio.h>
#include<cstring>
#include<ctype.h>
#include<wctype.h>
using namespace std;
int main()
{
int n;
cin>>n;
char komaki[10];
for(int i=0;i<10;i++) komaki[i]=' ';
int capslk=0;
char c;
string str;
for(int i=0;i<n;i++)
{
for(int j=0;j<10;j++) komaki[j]=' ';
cin>>komaki;
if(strcmp(komaki,"CAPS")==0)
{
// cout<<"--------"<<endl;
capslk++;
capslk=capslk%2;
}
else
{
if(capslk)
{
c=komaki[0];
str=str+(char)towupper(c);
//str=str+strupr(komaki);
}
else
{
str=str+komaki;
}
}
}
cout << str << endl;
return 0;
}