为什么会RE?
  • 板块P8506 标题计数
  • 楼主cyx156
  • 当前回复0
  • 已保存回复0
  • 发布时间2023/7/28 09:58
  • 上次更新2023/11/3 07:16:50
查看原帖
为什么会RE?
1021106
cyx156楼主2023/7/28 09:58
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k=0;
	bool bo=true;
	cin>>n;
	char ch=getchar();
	for(int j=1;j<=n;j++){
		int a=0;
		char s[100];
		while((s[a++]=getchar())!='\n');
		int i=0;
		while(s[i]!='#'){
			if(s[i]!=' '){
				bo=false;
				break;
			}
			i++;
			if(i==a){
				bo=false;
				break;
			}
		}
		if(bo==true&&s[i+1]==' '){
			k+=1;
		}
		bo=true;
	}
	cout<<k; 
	return 0;
}

c++代码如上

2023/7/28 09:58
加载中...