-
-
Save anonymous/24afb7d593b879659372 to your computer and use it in GitHub Desktop.
Daily Prog 4-14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
for (int p1 = 0; p1 <= 9; p1++){ | |
for(int p2 = 0; p2 <= 9; p2++){ | |
for(int p3 = 0; p3 <= 9; p3++){ | |
for(int p4 = 0; p4 <= 9; p4++){ | |
if(p1 != p2 && p1 != p3 && p1 != p4 && | |
p2 != p3 && p2 != p4 && p3 != p4){ | |
int firstSet = ((p1 * 100) + (p2 * 10)) / 10; | |
int secSet = ((p3 * 100) + (p4 * 10)) / 10; | |
int together = ((firstSet * 100) + secSet); | |
int added = firstSet + secSet; | |
if(together == (added * added)) | |
printf("%d IS A TORN NUMBER!!!\n", together); | |
} | |
} | |
} | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment