Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<fstream>
- #include<string.h>
- #include<stdio.h>
- #include<stdlib.h>
- using namespace std;
- int main(){
- ifstream f1("atestat.in");
- ofstream f2("atestat.out");
- char n[100];
- int i,j,b=0,c;
- f1.getline(n,100);
- for(i=0;i<strlen(n);i++)
- if(n[i] >= '0' && n[i]<='9')
- strcpy(n+i,n+i+1);
- for(i=1;i<strlen(n);i++)
- if(n[i-1] == ' ' && n[i] == ' ')
- strcpy(n+i-1,n+i);
- f2<<n<<endl;
- while(n[b] != ' ' ){
- b++;
- cout<<"am fost1"<<endl;
- }
- b++;
- for(j=b;j< strlen(n);j++){
- 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'){
- while(n[j] != ' ' && j< strlen(n))
- j++;
- j++;
- }
- if(n[j] != 'a' && n[j] != 'e' && n[j] != 'i' && n[j] != 'o' && n[j] != 'u') {
- c=j;
- while(n[c] != ' ' && c< strlen(n))
- c++;
- strcpy(n+j-1,n+c);
- j--;
- }
- }
- if(n[0] != 'a' && n[0] != 'e' && n[0] != 'i' && n[0] != 'o' && n[0] != 'u')
- strcpy(n,n+b);
- if(n[0] >= 'a' && n[0] <= 'z')
- n[0]=n[0]-32;
- f2<<n;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement