Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. #include<iostream>
  4. using namespace std;
  5. int main(){
  6. char s[999999];
  7. gets(s);
  8. long long count=0;
  9. if(s[0]!= ' ')
  10. count=1;
  11. for(int i=0;i<strlen(s)-1;i++){
  12. if(s[i]==' '&&s[i+1]!= ' ')
  13. count++;
  14. }
  15. cout<<count;
  16. long long cow=0;
  17. if(s[0]!= ' ')
  18. cow=1;
  19. for(int i=0;i<strlen(s)-1;i++){
  20. if(s[i]==46)
  21. cow++;
  22. }
  23. cout<<' '<<cow;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement