社区讨论
求助,gets函数用不了,用fgets函数0分
P5015[NOIP 2018 普及组] 标题统计参与者 6已保存回复 8
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 8 条
- 当前快照
- 1 份
- 快照标识符
- @lo8rg9va
- 此快照首次捕获于
- 2023/10/27 23:21 2 年前
- 此快照最后确认于
- 2023/10/27 23:21 2 年前
CPP
#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分啊!
回复
共 8 条回复,欢迎继续交流。
正在加载回复...