求助,gets函数用不了,用fgets函数0分
查看原帖
求助,gets函数用不了,用fgets函数0分
598441
koukou12138楼主2022/6/13 22:37
#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分啊!

2022/6/13 22:37
加载中...