Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <stdio.h>
- #include <math.h>
- #include <ctype.h>
- int main(void)
- {
- char restart[2];
- do
- {
- int ab = 0, cd = 0, index = 0, abcd1 = 0, abcd2 = 0;
- for (index = 1000; index < 10000; index++)
- {
- ab = index / 100;
- cd = index % 100;
- abcd1 = pow(ab, 2) + pow(cd, 2);
- abcd2 = pow((ab + cd), 2);
- if (index == abcd1 || index == abcd2)
- printf("\n\t%i", index);
- }
- printf("\n\nFertig. Moechten Sie das Programm neu starten? J/N\n");
- scanf("%c", restart);
- getchar();
- restart[0] = toupper(restart[0]);
- } while (restart[0] == 'J');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement