Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2016
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. /*
  2. This code sample was written to show what my device in minecraft is doing at a basic level,
  3. This is a lot faster than the one that I made but, It is a fair representation of how it works.
  4. Code example and map by 1mb_ram on Planetminecraft. I was too lazy to port code to linux or mac : )
  5. */
  6.  
  7. #include <iostream>
  8. using namespace std;
  9. int main() {
  10.     int s,m,h;
  11.     s = 9999; // seconds
  12.     m = 0; // minutes
  13.     h = 0; // hours
  14.     while (s > 60) {
  15.         s = s - 60;
  16.         m++;
  17.     }
  18.     while (m > 60) {
  19.         m = m - 60;
  20.         h++;
  21.     }
  22.     std::cout << s << " Second(s), " << m << " Minutes(s), " << "and " << h << " Hour(s)";
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement