Advertisement
tei123

Untitled

Mar 2nd, 2016
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. int i, l=0, lp=0;
  9. char cos[50];
  10. gets(cos);
  11. strlen(cos);
  12. for(i=0; i<strlen(cos); i++)
  13. if(cos[i]==' ') l++;
  14. cout<<"Zdanie sklada sie z "<<l+1<<" wyrazow."<<endl;
  15. cout<<"ciag sklada sie z "<<strlen(cos)-l<<" znaków."<<endl;
  16.  
  17.  
  18.  
  19.  
  20. system("PAUSE");
  21. return EXIT_SUCCESS;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement