Advertisement
MeehoweCK

Untitled

Jul 19th, 2018
203
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.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     string jakis_napis;
  8.     getline(cin, jakis_napis);      // pobiera cały wiersz, aż do entera
  9.     cout << jakis_napis << endl;
  10.     cout << jakis_napis.size () <<endl;
  11.     int licznik = 0;
  12.     for (int x = 0; x<jakis_napis.size(); x++)
  13.     {
  14.         if(jakis_napis[x]=='a')
  15.             licznik ++;
  16.     }
  17.     cout << "w napisie wystapilo a " << licznik <<endl;
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement