社区讨论

作为初学者的我能做出这道题真是个奇迹!

P1085[NOIP 2004 普及组] 不高兴的津津参与者 14已保存回复 15

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
15 条
当前快照
1 份
快照标识符
@mi5ha94p
此快照首次捕获于
2025/11/19 12:04
4 个月前
此快照最后确认于
2025/11/19 12:32
4 个月前
查看原帖
CPP
#include<iostream>
using namespace std;
int main(){
    int a1,a2,b1,b2,c1,c2,d1,d2,e1,e2,f1,f2,g1,g2,a,b,c,d,e,f,g,n;
    cin>>a1>>a>>b1>>b2>>c1>>c2>>d1>>d2>>e1>>e2>>f1>>f2>>g1>>g2;
    a=a1+a2;
    b=b1+b2;
    c=c1+c2;
    d=d1+d2;
    e=e1+e2;
    f=f1+f2;
    g=g1+g2;
    if((a>8)||(b>8)||(c>8)||(d>8)||(e>8)||(f>8)||(g>8))
    {
        n=a>b? a:b;
        n=n>c? n:c;
        n=n>d? n:d;
        n=n>e? n:e;
        n=n>f? n:f;
        n=n>g? n:g;
    }
    if(n==a)
    {
    cout<<1;
    return 0;
    }
    if(n==b)
    {
    cout<<2;
    return 0;
    }
    if(n==c)
    {
    cout<<3;
    return 0;
    }
    if(n==d)
    {
    cout<<4;
    return 0;
    }
    if(n==e)
    {
    cout<<5;
    return 0;
    }
    if(n==f)
    {
    cout<<6;
    return 0;
    }
    if(n==g)
    {
    cout<<7;
    return 0;
    }
    return 0;
}

回复

15 条回复,欢迎继续交流。

正在加载回复...