Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string.h>
- using namespace std;
- ifstream f("nr5.txt");
- int vocale(char x[])
- {
- int ct = 0;
- for(int i = 0; i < strlen(x); i++)
- {
- if(strchr("aeiouAEIOU", x[i]))
- {
- ct ++;
- }
- }
- return ct;
- }
- int main()
- {
- int ct = 0;
- char s[51];
- cin.getline(s, 50);
- cout << "Vocale: " << vocale(s);
- int n, pos = 0, ok;
- char cuv[30], aux[30];
- for(int i = 0; i < n; i++)
- {
- ok = 0;
- f >> cuv;
- if(vocale(cuv) >= 2)
- {
- for(int j = 0; j < strlen(cuv); j++)
- {
- if(strchr("aeiouAEIOU", cuv[j]))
- {
- ok = 1;
- for(int y = j; y < strlen(cuv); y++)
- {
- cuv[y] = cuv[y + 1];
- }
- cuv[strlen(cuv)] = NULL;
- break;
- }
- }
- if(ok == 1)
- {
- strrev(cuv);
- for(int j = 0; j < strlen(cuv); j++)
- {
- if(strchr("aeiouAEIOU", cuv[j]))
- {
- ok = 1;
- for(int y = j; y < strlen(cuv); y++)
- {
- cuv[y] = cuv[y + 1];
- }
- cuv[strlen(cuv)] = NULL;
- break;
- }
- }
- }
- cout << strrev(cuv) << " ";
- }
- else
- {
- cout << cuv << " ";
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement