Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <cstring>
- using namespace std;
- ifstream fin("capslock.in");
- ofstream fout("capslock.out");
- int main()
- {char s[1001],t[1001];
- int n,cnt=0,i=0;
- fin.getline(s,1001);
- for(n=0;s[n]!=0;n++)
- {if(s[n]=='#')
- {cnt++;n++;}
- if(cnt%2==1&& s[n]!=' ')
- t[i++]=s[n]-32;
- else
- {
- t[i++]=s[n];
- }
- }
- t[i]='\0';
- fout<<t;
- fout.close();
- return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement