3 solutions
-
1
#include<bits/stdc++.h> using namespace std; int main() { double a; cin>>a; if(a<=10) { cout<<fixed<<setprecision(2)<<a*0.8+0.2; } if(a<=20&&a>10) { cout<<fixed<<setprecision(2)<<(a-10)*0.75+10*0.8+0.2; } if(a<=30&&a>20) { cout<<fixed<<setprecision(2)<<10*0.8+10*0.75+(a-20)*0.7+0.2; } if(a>30) { cout<<"Fail"; } return 0; }
Information
- ID
- 2832
- Time
- 1000ms
- Memory
- 64MiB
- Difficulty
- 1
- Tags
- # Submissions
- 101
- Accepted
- 17
- Uploaded By