Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <conio.h>
- using namespace std;
- int main(){
- string tekst;
- char tab[6]={'a','e','i','o','y','u'};
- int ilesamoglosek=0,ileZ=0;
- cout<<fixed<<setprecision(3);
- getline(cin, tekst);
- for(int i=0;i<tekst.length();i++){
- cout<<tekst[i]<<endl;
- if (tekst[i]=='z') ileZ++;
- for(int j=0;j<6;j++){
- if (tekst[i]==tab[j]) ilesamoglosek++;
- }
- if (tekst[i]=='d') tekst[i]='X';
- }
- cout<<"samoglosek jest "<<ilesamoglosek<<" i wynosza "<<(float)ilesamoglosek/tekst.length()*100<<"% calosci"<<endl;
- cout<<"liter z jest "<<ileZ<<" i wynosza "<<(float)ileZ/tekst.length()*100<<"% calosci"<<endl;
- cout<<"tekst po zamianie: "<<tekst;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement