Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. void countdown(int time)
  2. {
  3. int h = (time / 3600);
  4. int m = (time / 60) - (h * 60);
  5. int s = time % 60;
  6.  
  7. std::stringstream ss;
  8. ss << h << ":" << m << ":" << s;
  9. std::string string = ss.str();
  10.  
  11. cout << "r" << string << endl;
  12. }
  13.  
  14. cout << "r" << string << endl;
  15.  
  16. 23:59:59
  17.  
  18. 0:0:0
  19.  
  20. std::cout << 'r'
  21. << std::setw(2) << std::setfill('0') << h << ':'
  22. << std::setw(2) << m << ':'
  23. << std::setw(2) << s << std::flush;
  24.  
  25. cout << "r" << string ; works
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement