Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- ifstream fin("capslock.in");
- ofstream fout("capslock.out");
- int main()
- {
- char v[256];
- fin.get(v, 256);
- int cnt = 0;
- for(int i=0; v[i]; i++)
- {
- if(isupper(v[i]))
- v[i] = (int) v[i] + 32;
- }
- for(int i=0; v[i]; i++)
- {
- if((int) v[i] == 35)
- {
- strcpy(v + i, v + i + 1);
- cnt ++;
- }
- if(cnt%2!=0 && islower(v[i]))
- v[i] = (int) v[i] - 32;
- }
- fout << v;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement