Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int policz(char* napis)
- {
- int i=0;
- int slowa = 0;
- if(napis[0]!=' ') slowa++;
- while(napis[i])
- {
- if(napis[i]>='a' && napis[i]<='z') napis[i]-=32;
- if(napis[i]==' ' && napis[i+1]!=' ') slowa++;
- i++;
- }
- return slowa;
- }
- int main()
- {
- char napis[]="ziobro kurwo jebana przestan moja rodzine przesladowac";
- cout << policz(napis) << endl;
- cout << napis;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement