编程题:10
import java.util.Scanner;

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

    double rate;
    if (years >= 5) {
        rate = 50;
    } else {
        rate = 30;
    }
    
    double salary;
    if (hours <= 40) {
        salary = hours * rate;
    } else {
        salary = 40 * rate + (hours - 40) * rate * 1.5;
    }
    
    System.out.printf("%.2f", salary);
}

}

posted on 2025-05-12 23:20  Swishy  阅读(4)  评论(0)    收藏  举报