疑问
查看原帖
疑问
1222005
hcodm楼主2024/7/10 08:30

虽然这道题我做对了,但是还有一个疑问。为什么其他题目可以用万能头,就这题不能?

这是一个编译错误的代码:

#include<bits\stdc++.h>
using namespace std;
bool b[101]={false};
long long int t,n,a,ans=0;
main(){
	cin>>t;
	for(int i=0;i<t;i++){
		cin>>n;
		for(int j=0;j<n;j++){
			cin>>a;	
			if(a==0){
				b[i]=true;
			
			}	
		}	
	}
	for(int i=0;i<t;i++){
		if(b[i]==false){
			cout<<"no\n";
		}else cout<<"yes\n";
	}
return 0;	
}

然后把#include<bits\stdc++.h>改成#include<iostream>就过了

2024/7/10 08:30
加载中...