有没有大佬帮忙看看为什么编译错误
  • 板块学术版
  • 楼主wangruikai
  • 当前回复6
  • 已保存回复6
  • 发布时间2024/10/18 21:46
  • 上次更新2024/10/19 07:49:45
查看原帖
有没有大佬帮忙看看为什么编译错误
1417512
wangruikai楼主2024/10/18 21:46

P5015

#include<bits/stdc++.h>
#include<cstring>
using namespace std;
int num;
int main()
{
	//freopen("5015.in","r",stdin);
	//freopen("5015.out","w",stdout);
	char s[10];
	gets(s);
	for(int i=1;i<=strlen(s);i++){
		if(s[i]==' '||s[i]=='\n') continue;
		num++;
	}
	cout<<num;
	return 0;
}

在dev c++里面没问题,提交就编译错误

2024/10/18 21:46
加载中...