中国大学MOOC-JAVA学习(浙大翁恺)—— 时间换算

 1 import java.util.Scanner;
 2 
 3 public class Main {
 4 
 5     public static void main(String[] args) {
 6         // TODO Auto-generated method stub
 7         Scanner in = new Scanner(System.in);
 8         int i;
 9         i = in.nextInt();
10         if(i>2359)
11         {
12             i = in.nextInt();
13         }
14         if(i>=1000||i>=800&&i<=959)
15         {
16             System.out.print(i-800);
17         }
18         if(i>=0&&i<800)
19         {
20             i=2400+(i-800);
21             System.out.print(i);
22         }
23     }
24 
25 }

猜你喜欢

转载自www.cnblogs.com/pxy-1999/p/10590162.html