Advertisement
alexon5519

40-programare

May 13th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. #include <iostream>
  2. #include<fstream>
  3. #include<string.h>
  4. #include<stdio.h>
  5. #include<stdlib.h>
  6.  
  7. using namespace std;
  8.  
  9. int main(){
  10. ifstream f1("atestat.in");
  11. ofstream f2("atestat.out");
  12. char n[100];
  13. int i,j,b=0,c;
  14. f1.getline(n,100);
  15. for(i=0;i<strlen(n);i++)
  16. if(n[i] >= '0' && n[i]<='9')
  17. strcpy(n+i,n+i+1);
  18. for(i=1;i<strlen(n);i++)
  19. if(n[i-1] == ' ' && n[i] == ' ')
  20. strcpy(n+i-1,n+i);
  21.  
  22. f2<<n<<endl;
  23. while(n[b] != ' ' ){
  24. b++;
  25. cout<<"am fost1"<<endl;
  26. }
  27. b++;
  28. for(j=b;j< strlen(n);j++){
  29. if(n[j] == 'a' || n[j] == 'e' || n[j] == 'i' || n[j] == 'o' || n[j] == 'u' || n[j] == 'A' || n[j] == 'E' || n[j] == 'I' || n[j] == 'O' || n[j] == 'U'){
  30. while(n[j] != ' ' && j< strlen(n))
  31. j++;
  32. j++;
  33. }
  34. if(n[j] != 'a' && n[j] != 'e' && n[j] != 'i' && n[j] != 'o' && n[j] != 'u') {
  35. c=j;
  36. while(n[c] != ' ' && c< strlen(n))
  37. c++;
  38. strcpy(n+j-1,n+c);
  39. j--;
  40. }
  41. }
  42. if(n[0] != 'a' && n[0] != 'e' && n[0] != 'i' && n[0] != 'o' && n[0] != 'u')
  43. strcpy(n,n+b);
  44. if(n[0] >= 'a' && n[0] <= 'z')
  45. n[0]=n[0]-32;
  46. f2<<n;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement