SHARE
TWEET

hourSymmetryDEBUG

avr39-ripe Jun 20th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "pch.h"
  2. #include <iostream>
  3.  
  4. int main()
  5. {
  6.     int totalSym = 0;
  7.     int hourH = 0, hourL = 0, minuteH = 0, minuteL = 0;;
  8.     for (int hour = 0; hour < 24; hour++)
  9.     {
  10.         hourL = hour % 10;
  11.         hourH = hour / 10;
  12.         for (int minute = 0; minute < 60; minute++)
  13.         {
  14.             minuteL = minute % 10;
  15.             minuteH = minute / 10;
  16.  
  17.             if ((hourL == minuteH) && (hourH == minuteL))
  18.             {
  19.                 totalSym++;
  20.                 std::cout << hourH << hourL << ":" << minuteH << minuteL << "\n";
  21.             }
  22.         }
  23.     }
  24.     std::cout << "Total symmetric: " << totalSym << "\n";
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top