Phoenix_Hijacker

pro

May 28th, 2015
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #include <iostream>
  2. #include <string.h>
  3. #include <stdlib.h>
  4. using namespace std;
  5.  
  6. int main (){
  7. int i,j,k,l,m,lcons;
  8. string frase, voc,cons;
  9. char punt[2];
  10.  
  11. cout<<" Inserisci la Parola : ";
  12. getline(cin, frase);
  13.  
  14. voc="aeiou";
  15. cons="bcdfghjklmnpqrstvwxyz";
  16. for(i=0;i<2;i++){
  17. cout<<"inserisci la punteggaitura : ";cin>>punt[i];
  18. }
  19. l=frase.size();
  20. cout<<"\n\n size of line "<<l<<" \n\n";
  21. m=0;
  22. for(i=0;i<l;i++){
  23. for(j=0;j<5;j++){
  24. if(frase[i]==voc[j])
  25. m++;
  26. }
  27.  
  28. }
  29. cout<<" Vocali "<<m<<endl;
  30. lcons=cons.size();
  31. m=0;
  32. for(i=0;i<l;i++){
  33. for(j=0;j<lcons;j++){
  34. if(frase[i]==cons[j])
  35. m++;
  36. }
  37.  
  38. }
  39. cout<<" consonanti "<<m<<endl;
  40.  
  41. m=0;
  42. for(i=0;i<l;i++){
  43. for(j=0;j<4;j++){
  44. if(frase[i]==punt[j])
  45. m++;
  46. }
  47.  
  48. }
  49. cout<<" punteggiatura "<<m;
  50.  
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment