Advertisement
Gireada

Tema nr.3

Oct 1st, 2013
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3.  
  4. int main()
  5. {
  6.     int n, i, v=0, c=0;
  7.     char t[n];
  8.     do
  9.     {std::cout<<"n=";std::cin>>n;}while(n>256);
  10.     for(i=0;i<n;i++)
  11.         std::cin>>t[i];
  12.     for(i=0;i<n;i++)
  13.         std::cout<<t[i];
  14.    
  15.     for(i=0;i<n;i++)
  16.         if(t[i] == 'a' || t[i] == 'e' || t[i] == 'i' || t[i] == 'o' || t[i] == 'u')    
  17.             v++;
  18.         else
  19.             c++;    
  20.    
  21.     std::cout<<"\n"<<"Vocale: "<<v<<"\n"<<"Consoane: "<<c; 
  22.     getch();       
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement