03:计算(a+b)/c的值-----JAVA

描述
      给定3个整数a、b、c,计算表达式(a+b)/c的值,/是整除运算。

  输入
      输入仅一行,包括三个整数a、b、c, 数与数之间以一个空格分开。(-10,000 < a,b,c < 10,000, c不等于0)
  输出
      输出一行,即表达式的值。
  样例输入
      1 1 3
  样例输出
      0
public class Main {
      public static void main(String[] args) {
          java.util.Scanner s = new java.util.Scanner(System.in);
          int a = s.nextInt();
          int b = s.nextInt();
          int c = s.nextInt();
          int n = (a + b )/c;
          System.out.println(n);
      }
}

猜你喜欢

转载自blog.csdn.net/weixin_46279994/article/details/127335658
今日推荐