3 条题解

  • 1
    @ 2024-12-7 13:56:47

    还有10分拿不到不知道怎么回事

    #include<bits/stdc++.h>

    using namespace std;

    int ji(int x,int y)

    {

    int s;
    
    s=x+y;
    
    return s;
    

    };

    struct student

    {

    int num,xueye,suzhi,zonghe,k;
    

    };

    student stu[10000];

    int ikun(int m,int n)

    {

    int t=0;
    
    if(m>140&&n>=80)
    
      t=1;
    
    else
    
    t=0;
    
    return t;
    

    };

    int main()

    {

    int N,h;
    
    cin>>N;
    
    for(int i=1;i<=N;i++)
    
    {
    
    	cin>>stu[i].num;
    
    	cin>>stu[i].xueye;
    
    	cin>>stu[i].suzhi;
    
    	stu[i].zonghe=0.7*stu[i].xueye+0.3*stu[i].suzhi;
    
    	stu[i].k=ji(stu[i].xueye,stu[i].suzhi);
    
    h=ikun(stu[i].k,stu[i].zonghe);
    
    if(h==1)
    
      cout<<"Excellent"<<endl;
    
    else if(h==0)
    
      cout<<"Not excellent"<<endl;}
    
    return 0;
    

    }

    • @ 2024-12-11 13:43:06

      本题存在精度误差问题,请将** a * 0.7 + b * 0.3 与 80 比较 转化为 **a * 7 + b * 3 与 800 比较。

    • @ 2024-12-18 13:18:56

      @ 郝仁啊

  • 0
    //洛谷上加了注释:
    //本题存在精度误差问题,请将 a * 0.7 + b * 0.3 与 80 比较 转化为 a * 7 + b * 3 与 800 比较。
    #include<bits/stdc++.h>
    using namespace std;
    struct student
    {
    	char xuehao[10010];
    	double sor7;
    	double sor3;
    };
    int main()
    {
    	student a;
    	int m;
    	cin>>m;
    	for(int i=1;i<=m;i++)
    	{
    		cin>>a.xuehao;
    		cin>>a.sor7;
    		cin>>a.sor3;
    		if(a.sor3*3+a.sor7*7>=800&&a.sor3+a.sor7>140) cout<<"Excellent"<<'\n';
    		else cout<<"Not excellent"<<'\n';
    	}
    	 
    	return 0;
    }
    
    • -2
      @ 2024-12-9 13:31:22
      #include<bits/stdc++.h>
      using namespace std;
      struct node {
          int id;
          double sc1, sc2;
          int score;
          double final_score;
      }a[100000];
      int main() {
          int n;
          cin >> n;
          for(int i=0; i<n; i++) {
              cin >> a[i].id >> a[i].sc1 >> a[i].sc2;
              a[i].score = a[i].sc1 + a[i].sc2;
              a[i].final_score = a[i].sc1 * 0.7 + a[i].sc2 * 0.3;//??????
          }
          for(int i=0; i<n; i++) {
              if(a[i].score > 140 && a[i].final_score >= 80) {//?????
                  cout << "Excellent" << endl;
              }
              else {
                  cout << "Not excellent" << endl;
              }
          }
          return 0;
      }
      
    • 1

    信息

    ID
    228
    时间
    1000ms
    内存
    256MiB
    难度
    8
    标签
    递交数
    59
    已通过
    9
    上传者