#45511: 薇閣113八年級校排1說話一下


1121226@stu.wghs.tp.edu.tw (Arthur✨小蜜蜂)

學校 : 臺北市私立薇閣高級中學
編號 : 252772
來源 : [60.248.154.143]
最後登入時間 :
2025-04-09 15:55:05
d980. 11479 - Is this the easiest problem? -- UVa11479 | From: [60.248.154.139] | 發表日期 : 2025-03-12 12:47

#include <bits/stdc++.h>
using namespace std;
int main(){
    long long int n; // 設立一個變數n
    long long int a[n]; // 設立一個陣列a
    cin>>n; // 輸入n
    for(int i=1;i<=n;i++){ 
        cin>>a[0]>>a[1]>>a[2];
        sort(a,a+3); // 排序
        if(a[0]+a[1]<=a[2]){ // 判斷是否為三角形
            cout<<"Case "<<i<<": Invalid"<<endl;
        }
        else if (a[0]==a[2]){ // 判斷是否為正三角形
            cout<<"Case "<<i<<": Equilateral"<<endl;
        }
        else if(a[0]==a[1]||a[1]==a[2]){ // 判斷是否為等腰三角形
            cout<<"Case "<<i<<": Isosceles"<<endl;
        }
        else{ // 判斷是否為普通三角形
            cout<<"Case "<<i<<": Scalene"<<endl;
        }
    }
    return 0;
}

 
#45512: Re: 薇閣113八年級校排1說話一下


1121226@stu.wghs.tp.edu.tw (Arthur✨小蜜蜂)

學校 : 臺北市私立薇閣高級中學
編號 : 252772
來源 : [60.248.154.143]
最後登入時間 :
2025-04-09 15:55:05
d980. 11479 - Is this the easiest problem? -- UVa11479 | From: [60.248.154.139] | 發表日期 : 2025-03-12 12:48

1121232@wghs.tp.edu.tw

 

 
#45513: Re: 薇閣113八年級校排1說話一下


1121226@stu.wghs.tp.edu.tw (Arthur✨小蜜蜂)

學校 : 臺北市私立薇閣高級中學
編號 : 252772
來源 : [60.248.154.143]
最後登入時間 :
2025-04-09 15:55:05
d980. 11479 - Is this the easiest problem? -- UVa11479 | From: [60.248.154.139] | 發表日期 : 2025-03-12 12:53

#include <bits/stdc++.h>
using namespace std;
int main(){
    long long int n; // 設立一個變數n
    long long int a[n]; // 設立一個陣列a
    cin>>n; // 輸入n
    for(int i=1;i<=n;i++){ 
        cin>>a[0]>>a[1]>>a[2];
        sort(a,a+3); // 排序
        if(a[0]+a[1]<=a[2]){ // 判斷是否為三角形
            cout<<"Case "<<i<<": Invalid"<<endl;
        }
        else if (a[0]==a[2]){ // 判斷是否為正三角形
            cout<<"Case "<<i<<": Equilateral"<<endl;
        }
        else if(a[0]==a[1]||a[1]==a[2]){ // 判斷是否為等腰三角形
            cout<<"Case "<<i<<": Isosceles"<<endl;
        }
        else{ // 判斷是否為普通三角形
            cout<<"Case "<<i<<": Scalene"<<endl;
        }
    }
    return 0;
}
 
ZeroJudge Forum