Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Euler 9.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- system("chcp 1252>NUL");
- const int sum = 1000;
- int a;
- for (a = 1; a < sum/3; a++)
- {
- int b;
- for (b = a + 1; b < sum/2; b++)
- {
- int c = sum - a - b;
- if (((a*a + b*b == c*c) && ((a+b+c) == 1000)));
- printf("a=%d, b=%d, c=%d\n", a, b, c);
- }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement