Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <conio.h>
  4.  
  5.  
  6. using namespace std;
  7.  
  8. int main(){
  9. string tekst;
  10. char tab[6]={'a','e','i','o','y','u'};
  11. int ilesamoglosek=0,ileZ=0;
  12. cout<<fixed<<setprecision(3);
  13. getline(cin, tekst);
  14. for(int i=0;i<tekst.length();i++){
  15. cout<<tekst[i]<<endl;
  16. if (tekst[i]=='z') ileZ++;
  17. for(int j=0;j<6;j++){
  18. if (tekst[i]==tab[j]) ilesamoglosek++;
  19. }
  20. if (tekst[i]=='d') tekst[i]='X';
  21. }
  22. cout<<"samoglosek jest "<<ilesamoglosek<<" i wynosza "<<(float)ilesamoglosek/tekst.length()*100<<"% calosci"<<endl;
  23. cout<<"liter z jest "<<ileZ<<" i wynosza "<<(float)ileZ/tekst.length()*100<<"% calosci"<<endl;
  24. cout<<"tekst po zamianie: "<<tekst;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement