1 solutions
-
0
C++ :
#include<cstdio> using namespace std; int main() { int a,b; for(int a=1;a<=1000;a++) { for(int b=1;b<=a;b++) { if(a+b==1245&&a*b==359784) { printf("%d %d",a,b); } } } return 0; }
Pascal :
var a,b,c:integer; begin for a:=1 to 1000 do for b:=1 to 1000 do if (a+b=1245) and (a*b=359784) and (a>b) then writeln(a,' ',b); end.
- 1
Information
- ID
- 2226
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- (None)
- # Submissions
- 0
- Accepted
- 0
- Uploaded By