#include<bits/stdc++.h> using namespace std; char s[10]; int a,b; int main() { fgets(s,10,stdin); a=strlen(s); b=a; for(int a1=1;a1<=a;a1++) { if(s[a1]==' ') b--; } cout<<b; return 0; }
gets函数为什么过不了编译啊!
为什么用fgets函数会0分啊!