Exercise02_07

 1 import javax.swing.JOptionPane;
 2 public class Years {
 3     public static void main(String[] args){
 4         String mine;
 5         int years,days,mines;
 6         mine=JOptionPane.showInputDialog(null,"输入分钟数");
 7         mines=Integer.parseInt(mine);
 8         years=mines/(60*24*365);
 9         days=mines%(60*24*365)/(60*24);
10         int messageType=JOptionPane.INFORMATION_MESSAGE;
11         String message=mines + " minutes is approximately " + years + " years and " + days + " days";
12         JOptionPane.showMessageDialog(null,message,"result",messageType );
13     }
14 }
原文地址:https://www.cnblogs.com/cherrydream/p/9799299.html