SHARE
TWEET

Untitled

a guest Jan 24th, 2020 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int ile_duzych(const char x[100])
  6. {
  7.     int ile=0,dlugosc=0;
  8.     for (int i=0;i<100;i++)
  9.     {
  10.         if((x[i]>=0)&&(x[i]<=126)) dlugosc++;
  11.     }
  12.     for(int i=0;i<dlugosc;i++)
  13.     {
  14.         if((x[i]>='A')&&(x[i]<='Z'))
  15.         {
  16.             ile++;
  17.         }
  18.     }
  19.     return ile;
  20. }
  21.  
  22. int main()
  23. {
  24.     char tekst[100];
  25.     for (int i=0;i<100;i++) tekst[i]=0;
  26.     cout<<"Wpisz swoja fraze: ";
  27.     cin.get(tekst,100);
  28.     cout<<"Ilosc duzych liter: "<<ile_duzych(tekst);
  29.     return 0;
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top