赞
踩
展开全部
直接看代码62616964757a686964616fe59b9ee7ad9431333363363562:import java.util.Scanner;
public class What {
public static void main(String[] args) throws Exception {
int x, y, z;
Scanner in = new Scanner(System.in);
x = in.nextInt();
y = in.nextInt();
z = in.nextInt();
in.close();
int result;
if (x
result = f();
} else if (x >= 0 && y
result = f(x);
} else if (x >= 0 && y >= 0 && z
result = f(x, y);
} else {
result = f(x, y, z);
}
System.out.println(result);
}
public static int f() {
return 0;
}
public static int f(int x) {
return x * x;
}
public static int f(int x, int y) {
return x * x + y * y;
}
public static int f(int x, int y, int z) {
return x * x + y * y + z * z;
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。