Skip to content

Instantly share code, notes, and snippets.

@hiyorineko
Created September 19, 2013 15:04
Show Gist options
  • Save hiyorineko/6624838 to your computer and use it in GitHub Desktop.
Save hiyorineko/6624838 to your computer and use it in GitHub Desktop.
説明つけた
class Hikaku{
public static void main(String[] a){
int A = 2;
int B = 10;
int C = 6;
if(A>B && A>C){
//if1のtrue時
if(B>C){
System.out.println("最大が"+A+"、次点が"+B);
}else{
System.out.println("最大が"+A+"、次点が"+C);
}else{
//if1のfalse時
if(B>C && B>A){
//if2のtrue時
if(A>C){
System.out.println("最大が"+B+"、次点が"+A);
}else{
//if2のfalse時
System.out.println("最大が"+B+"、次点が"+C);
}
if(A>B){
//↑なにこれ
System.out.println("最大が"+C+"、次点が"+A);
}else{
System.out.println("最大が"+C+"、次点が"+B);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment