import java.util.Scanner;
public class Main {
public static void main(String args[]) {
String s = "This is a C program.";
System.out.println(s);
}
}
三个整数和、积与平均值
import java.util.Scanner;
import java.text.DecimalFormat;//必须引入这个包
public class Main {
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
int a, b, c;
a = input.nextInt();
b = input.nextInt();
c = input.nextInt();
double ave;
ave = (double) (a + b + c) / 3;
// ave=(a+b+c)/3.0;
DecimalFormat format = new DecimalFormat("0.00");// 保留几位小数
System.out.println((a + b + c) + " " + a * b * c + " " + format.format(ave));
}
}