1 solutions

  • 0
    @ 2025-7-7 11:54:23
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	if(n<=10){
    		cout<<fixed<<setprecision(2)<<n*0.8+0.2;
    	}
    	if(n>10&&n<=20){
    		n=n-10;
    		cout<<fixed<<setprecision(2)<<n*0.75+8.2;
    	}
    	if(n>20&&n<=30){
    		n=n-20;
    		cout<<fixed<<setprecision(2)<<n*0.7+15.7;
    	}
    	if(n>30){
    		cout<<"Fail";
    	}
    	return 0;
    }
    
    
    
    • 1

    Information

    ID
    2832
    Time
    1000ms
    Memory
    64MiB
    Difficulty
    10
    Tags
    # Submissions
    8
    Accepted
    2
    Uploaded By