The 2018 JUST Collegiate Programming Contest D题 Balloons

没什么好补的,,凑个过题数?

#include<iostream>
using namespace std;
int main(){
	int t,n,ans;
	cin>>t;
	while(t--){
		cin>>n;
		ans=0;
		for(int i = 0 ; i < n ; i ++){
			int temp;
			cin>>temp;
			if(temp!=0) ans++;
		}
		cout<<ans<<endl;
	}
	return 0;
}

猜你喜欢

转载自blog.csdn.net/JSLS_WFQ/article/details/89241353