Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<conio.h>
- #include <cmath>
- using namespace std;
- float compute(float start, int duration){
- int ora_h = 0;
- ora_h = floor(start); //Cel mai mare intreg mai mic decat numarul
- float minutesLeft = start - ora_h;
- cout<<endl<<minutesLeft<<endl;
- minutesLeft *= 100;
- minutesLeft += duration;
- int plus_h;
- plus_h= floor(minutesLeft / 60);
- minutesLeft=minutesLeft-plus_h*60;
- ora_h=ora_h+plus_h;
- cout<<endl<<ora_h<<endl;
- cout<<endl<<minutesLeft<<endl;
- getch();
- minutesLeft = int(ceil(minutesLeft)) % 60;
- minutesLeft /= 100;
- ora_h += minutesLeft;
- return ora_h;
- }
- int main()
- {
- // cout<<
- compute(8.50,69);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement