JAVA晚自习作业

练习1

import java.util.Scanner;

public class Mying1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        int c = in.nextInt();
        int sum = a+b+c;
        System.out.println(sum);
    }
}

练习2

import java.util.Scanner;

public class Mying2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        int c = in.nextInt();
        int he = a+b;
        if (he>c){
            System.out.println(true);
        }else if (he<=c){
            System.out.println(false);
        }
    }
}

练习3

import java.util.Scanner;

public class Mying3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        int c = in.nextInt();
        int d = in.nextInt();
        int he = a+b+c-d;
        if (he>0){
            System.out.println(true);
        }else if (he<=0){
            System.out.println(false);
        }
    }
    }
练习4
import java.util.Scanner;

public class Mying4 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int chang = in.nextInt();
        int kuan = in.nextInt();
        int mianji = chang*kuan;
        System.out.println("面积是"+mianji);

    }
}

练习5

import java.util.Scanner;

public class Mying5 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int r = in.nextInt();
        double t = 3.14;
        System.out.println("面积"+(r*r*t));
    }
}

练习6

import java.util.Scanner;

public class Ner1 {
    public static void main(String[] args) {
        Scanner in =new Scanner(System.in);
        int shengao = in.nextInt();
        int tizong = in.nextInt();
        System.out.println("你的标准身高是:"+(shengao+tizong)/2);
    }
}

练习7

import java.util.Scanner;

public class Ner2 {
    public static void main(String[] args) {
        Scanner in =new Scanner(System.in);
        int xinzi = in.nextInt();
        double shenlu = 0.01;
        System.out.println("实际到手工资是:"+(1-shenlu)*xinzi);
    }
}

练习8

import java.util.Scanner;

public class Ner3 {
    public static void main(String[] args) {
        Scanner in =new Scanner(System.in);
        int zs = in.nextInt();
        System.out.println("整数平方为"+zs*2);
    }
}

练习9

import java.util.Scanner;

public class Ner4 {
    public static void main(String[] args) {
        Scanner in =new Scanner(System.in);
        int num = in.nextInt();
        int s = num%2;
        if(s==0){
            System.out.println("偶数");

        }else {
            System.out.println("奇数");
        }
    }
}

练习10

import java.util.Scanner;

public class Ner5 {
    public static void main(String[] args) {
        Scanner in =new Scanner(System.in);
        int sr = in.nextInt();
        int sz = sr-20;
        if (sr>sz){
            System.out.println("果真吗");
        }else {
            System.out.println("成年了");
        }
    }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值