求助,为什么出错
查看原帖
求助,为什么出错
1029602
tekira楼主2024/3/15 17:57
#include<bits/stdc++.h>
using namespace std;

int main(){
    int a[3];
    cin>>a[0]>>a[1]>>a[2];
    bool flag=true;
    for(int i=0;i<3;i++){
        int temp=i+1,temp1=i+2;
        if(temp>2)temp=0;
        if(temp1>2)temp1=0;
        if(a[i]+a[temp]<a[temp+1])flag=false;
    }
    if(flag)cout<<1;
    else cout<<0;
    return 0;
}
2024/3/15 17:57
加载中...