(a+b)*c=?,赋值ab,给我弄一个输出c答案的代码 Java的 写的来不啊

2024-12-22 23:57:07
推荐回答(2个)
回答1:

public class ccc {
public static void main (String args[]){

java.util.Scanner sa=new java.util.Scanner(System.in);
String a = sa.nextLine();
java.util.Scanner sb=new java.util.Scanner(System.in);
String b = sb.nextLine();
int c=10;
System.out.println(((Integer.valueOf(a)+Integer.valueOf(b))*c);
}
}

回答2:

public class ccc {
public static void main (String args[]){

java.util.Scanner sin=new java.util.Scanner(System.in);
int a=10;
int b=5;
String c = sin.nextLine();
System.out.println((a+b)*Integer.valueOf(c));
}
}