Guest User

Untitled

a guest
Feb 13th, 2015
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main() {
  4.     int buf;
  5.     int Buf[5] = {0,0,0,0,0};
  6.  
  7.     for (int i = 1; i < 999; i++) {
  8.         for (int j = 1; j < 99; j++) {
  9.             buf = i*j;
  10.             Buf[4] = buf % 10;
  11.             Buf[3] = (buf / 10) % 10;
  12.             Buf[2] = (buf / 100) % 10;
  13.             Buf[1] = (buf / 1000) % 10;
  14.             Buf[0] = buf / 10000;
  15.  
  16.             if (i%10 == j%10 && (i/10)%10 == j/10) {
  17.                 if (Buf[1]==Buf[4] && Buf[2] == (i/100) && Buf[3] == ((i/10)%10)) {
  18.                     std::cout << i << " " << j << std::endl;
  19.                     std::cout << "---" << std::endl;
  20.                 }
  21.             }
  22.         }
  23.     }
  24.  
  25.     getchar();
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment