Advertisement
tei123

Untitled

Mar 2nd, 2016
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. void zad4(char *napis)
  2. {
  3. int dl = strlen(napis);
  4. for(int i=0; i<dl; i++)
  5. {
  6. if (napis[i]>=97)
  7. napis[i]=napis[i]-32;
  8. }
  9. }
  10. int main()
  11. {
  12. int i, l=0, lp=0;
  13.  
  14. char cos[255];
  15.  
  16. gets(cos);
  17. strlen(cos);
  18. for(i=0; i<strlen(cos); i++)
  19. if(cos[i]==' ')
  20. l++;
  21.  
  22. cout<<"Zdanie ma: "<<l+1<<" wyrazow."<<endl;
  23. cout<<"Ciag ma: "<<strlen(cos)-l<<" znakow."<<endl;
  24.  
  25.  
  26. system("PAUSE");
  27. return EXIT_SUCCESS;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement