访客只能看到部份内容,免费 加入会员 或由脸书 Google 可以看到全部内容
import java.io.*; public class ex5_10 { public static void main(String[] args) throws IOException { int time = 0, sum = 0, total = 0, total2 = 0, total3 = 0, total4 = 0; InputStreamReader in = new InputStreamReader(System.in); BufferedReader buf = new BufferedReader(in); System.out.print("请输入整月的工作时数:"); time = Integer.parseInt(buf.readLine()); System.out.print("请输入固定时薪:"); sum = Integer.parseInt(buf.readLine()); if (sum >= 121) { total = 60 * sum; total2 = (int) (sum * 1.33) * 60; total3 = (int) (sum * 1.66) * (time - 120); total4 = total + total2 + total3; System.out.println("薪水为:" + total4); } else if (sum >= 61) { total = 60 * sum; total2 = (int) (sum * 1.33) * (time - 60); total3 = total + total2; System.out.println("薪水为:" + total3); } else { total = time * sum; System.out.println("薪水为:" + total); } } }