Advertisement
Guest User

Untitled

a guest
Dec 16th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <fstream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5. ifstream fin("capslock.in");
  6. ofstream fout("capslock.out");
  7. int main()
  8. {char s[1001],t[1001];
  9. int n,cnt=0,i=0;
  10. fin.getline(s,1001);
  11. for(n=0;s[n]!=0;n++)
  12. {if(s[n]=='#')
  13. {cnt++;n++;}
  14. if(cnt%2==1&& s[n]!=' ')
  15. t[i++]=s[n]-32;
  16. else
  17. {
  18. t[i++]=s[n];
  19. }
  20. }
  21. t[i]='\0';
  22. fout<<t;
  23. fout.close();
  24. return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement