题解 | 简单运算

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.close();

        //write your code here......
        if(a<b){
            int temp=a;
            a=b;
            b=temp;
        }
        int add=a+b;
        int jian=a-b;
        int cheng=a*b;
        int chu=a/b;
        int mo=a%b;
        System.out.print(add+" ");
        System.out.print(jian+" ");
        System.out.print(cheng+" ");
        System.out.print(chu+" ");
        System.out.print(mo+" ");


    }
}

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务