返回列表 發帖
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int a,b,c;
  4. struct P
  5. {
  6.     string s;
  7.     int n;
  8. };
  9. bool compare(P p1,P p2)
  10. {
  11.     return p1.n<p2.n;
  12. }
  13. int main()
  14. {
  15.     cin.tie(0);
  16.     cin.sync_with_stdio(0);
  17.     while(cin>>a>>b>>c)
  18.     {
  19.         P p[3];
  20.         p[0].s="A";
  21.         p[0].n=a;
  22.         p[1].s="B";
  23.         p[1].n=b;
  24.         p[2].s="C";
  25.         p[2].n=c;
  26.         sort(p,p+3,compare);
  27.         if(p[0].n+p[1].n>p[2].n)
  28.             cout<<p[1].s<<endl;
  29.         else
  30.             cout<<p[2].s<<endl;
  31.     }
  32.     return 0;
  33. }
複製代碼

TOP

返回列表