请计算a - b / (c++) - 1.5 + 'a'的结果,a,b,c为任意三个整数
int a,b,c;
double s=0;
scanf("%d %d %d",&a,&b,&c);
s = a-b/(c++)-1.5+'a';
字符a的整形值是97
'a' = 97
public static void main(String[] args) throws Exception {
int a, b, c;
Scanner sc = new Scanner(System.in);
System.out.println("请输入a的值: ");
a = sc.nextInt();
System.out.println("a= " + a);
System.out.println("请输入b的值: ");
b = sc.nextInt();
System.out.println("b= " + b);
System.out.println("请输入c的值: ");
c = sc.nextInt();
System.out.println("c= " + c);
if (c == 0) {
throw new Exception("c的值不能为0");
}
double s = a - b / (c++) - 1.5 + 'a';
System.out.println("a - b / (c++) - 1.5 + 'a'的值为: " + s);
}
运行结果: