Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string.h>
  4.  
  5. using namespace std;
  6. char A[250];
  7. int main()
  8. {
  9. ifstream f("nevek.in");
  10. f.getline(A,250);
  11. cout <<A << endl;
  12. for(int i=0;i<=250;i++)
  13. {
  14. if (A[i]==A[i+1] && A[i]==' ')
  15. {
  16. for(int j=i;j<strlen(A);j++)
  17. A[j]=A[j+1];
  18. i--;
  19. }
  20. }
  21. A[0]=A[0]-32;
  22. for(int i=1;i<=250;i++)
  23. {
  24. if (A[i]==' ' && A[i+1]!=' ')
  25. {
  26. A[i+1]=A[i+1]-32;
  27. }
  28. }
  29.  
  30.  
  31. cout <<A << endl;
  32. f.close();
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement