angelavaida27

Var58_SII_Ex5

Nov 18th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4. char alt[55], aux[55];
  5. int main ()
  6. {
  7.     int n, i, k=0;
  8.     cin.getline(alt, 55);
  9.     n=strlen(alt);
  10.     for (i=0; i<n; i++)
  11.     {
  12.         if (alt[i]>='A' && alt[i]<='Z' || alt[i]>='a' && alt[i]<='z')
  13.         {
  14.             aux[k]=alt[i];
  15.             k++;
  16.         }
  17.     }
  18.     cout<<aux;
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment