Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <cstring>
  4. using namespace std;
  5. char s[250];
  6.  
  7. int s1(char s[])
  8. {
  9. int t=0,i;
  10. char voc[]="aeiou";
  11. for (i=0;i<strlen(s);i++)
  12. if (strchr(voc,s[i])==NULL) t++;
  13. return t;
  14. }
  15.  
  16. void s2(char s[])
  17. {
  18. char s1[50];
  19. int i,j;
  20. s1[0]=0;j=0;
  21. char voc[]="aeiou";
  22. for (i=0;i<strlen(s);i++)
  23. if (strchr(voc,s[i])==NULL)
  24. {strncat(s1,s+i,1);
  25. strncat(s1,s+i,1);
  26. }else
  27. {
  28. strncat(s1,s+i,1);
  29. strcat(s1,"\n");
  30. strcpy(s,s1);
  31. }
  32.  
  33. int main()
  34. {
  35. ifstream f("date.in");
  36. ofstream g("date.out");
  37. f>>s;g<<s1(s)<<endl;
  38. s2(s);g<<s;g.close();
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement