java第十版编程题目:求出年数
package nameyu;import java.util.Scanner;public class Test { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner input=new Scanner(System.in); System.out.print("Enter the number of minutes :"); int number =input.nextInt(); int years=number/(60*24*365);// int days=number%(60*24*365); int days=number/(60*24)-years*365; System.out.println(days); }}
页:
[1]