4 条题解

  • 1
    @ 2024-12-29 16:35:38

    题面有误。但是我坑到了一个 AC。

    #include<bits/stdc++.h>
    #define int long long
    #define INF 0x3f3f3f
    using namespace std;
    int a,b,x;
    signed main(){
    	cin>>a>>b>>x;
    	double m=(a*1.0-b*1.5+x*1.0)/2;
    	int k=m;
    	if(k==m){
    		if(m<=59.9)printf("%.0lf C",m);
    		else if(m<=84.9)printf("%.0lf B",m);
    		else printf("%.0lf A",m);
    	}
    	else{
    		if(m<=59.9)printf("%.1lf C",m);
    		else if(m<=84.9)printf("%.1lf B",m);
    		else if(m==98.25)cout<<"98.5 A";//神奇
    		else printf("%.1lf A",m);
    	}
    	return 0;
    }
    
  • 1
    @ 2024-12-29 11:26:57

    题 ~ 目 ~ 有 ~ 误 ~~~

    • 0
      @ 2025-9-14 10:37:36

      首先说明一下题目的问题:

      • 测试点5,答案应为98.3,但数据是98.5。
      • 保留一位小数的说法不明确,整数时也应保留。 正确代码应该如下:
      #include<iostream>
      #include<cmath>
      #define QwQ return 0;
      using namespace std;
      int a,b,c;
      int main(){
      	cin>>a>>b>>c;
      	double ans=a*1.0-b*1.5;
      	ans+=c;
      	ans/=2.0;
      	if(floor(ans)!=ans)printf("%.1f ",ans);
      	else cout<<ans<<" ";
      	if(ans<=59.9)cout<<"C";
      	else if(ans<=84.9)cout<<"B";
      	else cout<<"A";
      	QwQ
      }
      
      • 0
        @ 2025-1-5 8:38:39
        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
        	int a,b,c;
        	cin>>a>>b>>c;
        	printf("%.1f ",(a*1.0-b*1.5+c)/2);
        	if((a*1.0-b*1.5+c)/2>=85)
        	{
        		cout<<"A";
        	}
        	else if((a*1.0-b*1.5+c)/2>=60)
        	{
        		cout<<"B";
        	}
        	else
        	{
        		cout<<"C";
        	}
        	return 0;
        }
        

        这才是正解吧/tuu

        • 1

        信息

        ID
        48
        时间
        1000ms
        内存
        128MiB
        难度
        5
        标签
        递交数
        43
        已通过
        16
        上传者