Java程序第三次作业

package com.homework03;

import java.util.Scanner;

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

        int b = scanner.nextInt();
        int c = a;
        a = b;
        b = c;
        System.out.println("output: " + a + " " + b);
    }
}

package com.homework03;

import java.util.Scanner;

public class Main02 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);


        int n0 = scanner.nextInt();
        int n1 = scanner.nextInt();
        System.out.println((n0 + n1) * (n0 + n1));
    }
}


posted @ 2021-03-25 13:06  SuoJing  阅读(32)  评论(0编辑  收藏  举报