Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main() {
- int buf;
- int Buf[5] = {0,0,0,0,0};
- for (int i = 1; i < 999; i++) {
- for (int j = 1; j < 99; j++) {
- buf = i*j;
- Buf[4] = buf % 10;
- Buf[3] = (buf / 10) % 10;
- Buf[2] = (buf / 100) % 10;
- Buf[1] = (buf / 1000) % 10;
- Buf[0] = buf / 10000;
- if (i%10 == j%10 && (i/10)%10 == j/10) {
- if (Buf[1]==Buf[4] && Buf[2] == (i/100) && Buf[3] == ((i/10)%10)) {
- std::cout << i << " " << j << std::endl;
- std::cout << "---" << std::endl;
- }
- }
- }
- }
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment