题解:UVA13034 Solve Everything :-)

· · 题解

题解:UVA13034 Solve Everything :-)

建议评 \color{red}红

别被题目所误导,这就是一道判断是否存在数字 0 的题目,如果存在 0 就说明这一题每个团队都做不出来。

本题最难的就是输出,注意大小写和空格,建议直接复制格式。

代码

容易实现,浅浅放个代码,仅供参考:

#include <bits/stdc++.h>

using namespace std;

int t,fn;

int main(void){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    cin.tie(0)->sync_with_stdio(false);
    cout.tie(0)->sync_with_stdio(false);
    cin>>t; //多组数据
    for(int i=1;i<=t;i++){
        for(int j=1,x;j<=13;j++){
            cin>>x;
            if(x==0){
                fn=1; //是否存在 0
                break;
            }
        }
        if(fn==1){
            cout<<"Set #"<<i<<": "<<"No\n"; //输出
        }else{
            cout<<"Set #"<<i<<": "<<"Yes\n";//输出
        }
    }
    return 0;
}