Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main()
- {
- int hh, mm;
- double h, h1, d, d1, c, n, a=0, b=0;
- cin>>hh>>mm;
- cin>>h>>d>>c>>n;
- if(h>0)
- {
- if(hh>=20 && hh<24)
- {
- c=(c/100)*80;
- while(h>0)
- {
- a+=c;
- h-=n;
- }
- }
- if(hh<20)
- {
- d1=d;
- h1=h;
- while(h1>0)
- {
- b+=c;
- h1-=n;
- }
- while(hh<20)
- {
- for(int i=0;i<61;i++)
- {
- if(mm==60)
- {
- hh+=1;
- mm=0;
- break;
- }else{
- mm+=1;
- h+=d;
- }
- }
- }
- c=(c/100)*80;
- while(h>0)
- {
- a+=c;
- h-=n;
- }
- }
- }
- else{cout<<fixed<<setprecision(3)<<a<<endl;return 0;}
- if(b==0 && a!=0){cout<<fixed<<setprecision(3)<<a<<endl;return 0;}
- else if(b!=0 && a!=0){
- if(b>a){cout<<fixed<<setprecision(3)<<a<<endl;return 0;}
- else{cout<<fixed<<setprecision(3)<<b<<endl;return 0;}
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement