Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int policz(char* napis)
  5. {
  6. int i=0;
  7. int slowa = 0;
  8. if(napis[0]!=' ') slowa++;
  9. while(napis[i])
  10. {
  11. if(napis[i]>='a' && napis[i]<='z') napis[i]-=32;
  12. if(napis[i]==' ' && napis[i+1]!=' ') slowa++;
  13. i++;
  14. }
  15.  
  16. return slowa;
  17. }
  18.  
  19. int main()
  20. {
  21. char napis[]="ziobro kurwo jebana przestan moja rodzine przesladowac";
  22. cout << policz(napis) << endl;
  23. cout << napis;
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement