Advertisement
ItsMeLucifer

Zamiana Wielkości Liter C++

Apr 10th, 2019
554
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2. #include <cctype>
  3. #include <ctype.h>
  4. #include <cstring>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.  
  11.     string temp;
  12.     cout<<"Podaj napis"<<endl;
  13.     cin>>temp;
  14.     int n=temp.length();
  15.     char napis[n+1];
  16.     strcpy(napis,temp.c_str());
  17.     for(int i=0;i<temp.length();i++){
  18.         bool cos = isspace(napis[i]);
  19.         if(!cos){
  20.         if(napis[i]>96){
  21.             napis[i]-=32;
  22.         }else{
  23.         napis[i]+=32;
  24.         }
  25.         cout<<napis[i];
  26.         }
  27.     }
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement