Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
113277 吴梓玄 31统计单词数 C++ Runtime Error 1 MS 268 KB 234 2025-03-15 16:24:47

Tests(2/10):


Code:

#include <bits/stdc++.h> using namespace std; int main() { char s[1005]; gets(s); int n=0; int m=strlen(s); for(int i=0;i<m;i++){ if (i==0 || s[i-1]==' ' && s[i]!=' '){ n=n+1; } } cout<<n; return 0; }


Run Info:

Runtime Error:Segmentation fault