2 条题解

  • 0
    @ 2024-12-29 11:09:52
    #include<bits/stdc++.h>
    #define int double
    using namespace std;
    signed main(){
    	int n,a,b;
    	cin>>n;
    	b=n*4.8;
    	if(n<=2)a=n*5;
    	else a=10+(n-2)*4;
    	if(a<b)cout<<"甲店";
    	else if(a>b){
    		cout<<"乙店 ";
    		cout<<fixed<<setprecision(1)<<b;
    	}
    	else cout<<"一样";
    }
    
    
    • 0
      @ 2024-12-29 10:22:58

      什么啊怎么没数据:

      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
      	int n;
      	cin>>n;
      	if(min(2,n)*5+(n-2)*5*0.8<n*8*0.6)
      	{
      		cout<<"甲 ";
      		printf("%.1f",min(2,n)*5+(n-2)*5*0.8);
      	}
      	else
      	{
      		cout<<"乙 ";
      		printf("%.1f",n*8*0.6);
      	}
      	return 0;
      }
      
      • 1

      信息

      ID
      45
      时间
      1000ms
      内存
      128MiB
      难度
      10
      标签
      递交数
      14
      已通过
      0
      上传者