Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- struct time {
- string meridiem; // AM or PM
- int hour;
- int minute;
- int seconds;
- };
- void sleeptime(time &t,int sleepAmount) {
- t.hour += sleepAmount;
- }
- void blackBox (time &t, int magicNumber){
- t.hour += magicNumber;
- t.minute -= magicNumber;
- }
- int main() {
- time t1;
- t1.meridiem = "AM";
- t1.hour = 9;
- t1.minute = 33;
- t1.seconds = 54;
- //cout << t1.hour << " : " << t1.minute << "." << t1.seconds << " " << t1.meridiem << endl;
- time t2;
- t2.meridiem = "PM";
- t2.hour = 11;
- t2.minute = 20;
- t2.seconds = 47;
- //cout << t2.hour << " : " << t2.minute << "." << t2.seconds << " " << t2.meridiem << endl;
- cout << "If you go to sleep at:" << cout << t2.hour << " " << t2.meridiem << endl;
- sleeptime(t2, 9);
- cout << "You should wake up at:" << cout << t2.hour << " " << t2.meridiem << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement