首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
曾不会
2026年2月14日 13:26
统计单词 题解:
P1394
回复 0
|
赞 0
|
浏览 64
while(1): try: iin=input() ll=len(iin) nn=iin[:ll-1] s = list(map(str, nn.split())) l = len(s) for i in range(l): out=0 for j in s[i]: out+=1 print(out,end=' ') pr...
bro
2026年2月8日 14:36
统计单词 题解:c++
P1394
回复 0
|
赞 6
|
浏览 236
#include <bits/stdc++.h> using namespace std; int main() { string s ; while(getline(cin,s)){ int temp = 0; for(int i = 0 ; i < s.size() ; i++){ &nb...
ryuki
2026年2月5日 21:03
统计单词 题解:句号前有空格
P1394
回复 0
|
赞 3
|
浏览 149
#include <iostream> #include <string> #include <cctype> using namespace std; int main() { string str; int cnt; while(cin >> str) { if(str.size() == 1 && str[0]...
xsw
2026年2月3日 17:03
统计单词 题解:
P1394
回复 0
|
赞 5
|
浏览 129
#include<iostream> using namespace std; int main() { string s; while (getline(cin, s)) { int cnt = 0; for (int i = 0; i < s.size(); i ++ ) { if (s[i] != ' ' && s[i] != '.') { cnt ++ ; } else { if (cnt) cout << cnt << ' '; cn...
kawhileo
2026年1月31日 23:04
统计单词 题解:有坑——句号前会有空格
P1394
回复 0
|
赞 4
|
浏览 147
#include<bits/stdc++.h> using namespace std; int main() { string s; while(getline(cin,s)){//一行全部都进来给s int len=s.size(); int c[len]={0}; int word_len=0,word_num=0,tag=1;//...
mlx
2026年1月30日 22:03
统计单词 题解:
P1394
回复 0
|
赞 2
|
浏览 118
#include<iostream> using namespace std; char s[1010]; int main() { string str; while(cin.getline(s,110)) { int cnt=0; for(int i=0;s[i]!='.';i++) { if(s[i]>='a'&&s[i]<='z') { cnt++; if(s[i+1]==' '||s[i+1]=='.') { cout<<...
yauqq
2026年1月29日 09:59
统计单词 题解:
P1394
回复 0
|
赞 3
|
浏览 143
#include<bits/stdc++.h> using namespace std; int main(){ char c; int length = 0; while(cin.get(c)){ if(c == '.'){ if(length > 0) cout << length; cout << endl; length = 0; } else{ if(isspace(c)){ if(length > 0){ cout <&...
SpontySoul
2026年1月25日 17:40
统计单词 题解:
P1394
回复 0
|
赞 2
|
浏览 188
#include <bits/stdc++.h> using namespace std; int main() { string s; while(getline(cin, s)){ size_t len = s.size(); s[len - 1] = ' '; // 将末尾的.换成空格 int l = 0; for(size_t i = 0; i < len; i++){ if(s[i] != ' ') ...
曾不会
2026年1月24日 18:08
统计单词 题解:
P1394
回复 0
|
赞 1
|
浏览 113
长度为0的时候不要输出就好了 while(1): try: num = list(map(str, input().split())) n = len(num) for i in range(n): k = list(num[i]) if (i == n - 1): if(len(k)-1==0): { } e...
曾不会
2026年1月24日 18:06
统计单词 题解:
P1394
回复 0
|
赞 0
|
浏览 120
分析每一种情况 #include<bits/stdc++.h> int main() { char c; int count=0; while(c=getchar()) { if(c!='.') { ...
1
2
3
...
6
题目
统计单词
题解数量
53
发布题解
在线答疑
热门题解
1
统计单词 题解:写出这么简单的代码也是神人了
2
纯纯逆天测试例(‘.'前有可能是空格)
3
统计单词 题解:
4
统计单词 题解:可过,判断条件很简单
5
统计单词(C++) 题解:
6
统计单词 题解:
7
统计单词 题解:
8
统计单词 题解:测试用例只有一个坑,别的很基本
9
就挺离谱的。。
10
统计单词 题解: