Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PE #9
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//Title of this code //'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_45 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { int sum = 0; int TARGET = 1000; int sqrTAR =(int) Math.sqrt(TARGET); double c = 0; for (int b=2; b<1000; b++) { for (int a=1; a<1000; a++) { c = getC(a, b); if (((a + b + c)==TARGET)&&(a<b)) { System.out.println("a: "+a+", b: "+b+", c: "+c); double ans = a*b*c; System.out.println("Ans: "+ans);} } } } public static double getC(int a, int b) { double getc = 0; getc = Math.sqrt((double)(a*a) + (b*b)); return getc; } }
[
+
]
Show input
Compilation time: 0.82 sec, absolute running time: 0.14 sec, cpu time: 0.11 sec, memory peak: 33 Mb, absolute service time: 0.97 sec
fork mode
|
history
|
discussion
a: 200, b: 375, c: 425.0 Ans: 3.1875E7