Advertisement
aimon1337

Untitled

Nov 29th, 2020
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <cstring>
  4. #include <cmath>
  5. using namespace std;
  6. // ifstream fin ("bac.txt");
  7. // ofstream fout("iesire.txt");
  8. int main(){
  9.     char s[255];
  10.     char voc[]="AEIOU";
  11.     char *p;
  12.     int i, nr=0, fr[150]={0};
  13.     cin.get(s,255);
  14.     char s2[255];
  15.     strcpy(s2,s);
  16.     p=strtok(s," ");
  17.     while(p){
  18.         nr++;
  19.         p=strtok(NULL," ");
  20.     }
  21.     for(i=0;i<strlen(s2);++i){
  22.         if(strchr(voc,s2[i])==NULL){
  23.             fr[(int)s2[i]]=1;
  24.         }
  25.     }
  26.     cout<<nr<<endl;
  27.     for(i=(int)'A';i<=(int)'Z';++i){
  28.         if(fr[i]==1){
  29.             cout<<(char)fr[i]<<" ";
  30.         }
  31.     }
  32. //  fin.close();
  33. //  fout.close();
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement