1 solutions
-
0
C :
#include<stdio.h> #include<string.h> #define N 100 int fun(char *p); int main() { char f[100],*p = f; int n=0; gets(f); n=fun(f); printf("%d",n); return 0; } int fun(char *p) { int n=0; while(*p!='\0') { if(*p==' ') n++; p++; } n=n+1; return n; }C++ :
#include<iostream> using namespace std; int main() { int mm=0; string s; while(cin>>s) { mm++; } cout<<mm; return 0; }
- 1
Information
- ID
- 17178
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By