初学Java 数值运算符
2021-07-03 05:04
标签:second [] seconds and enter scanner import system system.in import java.util.Scanner; } 初学Java 数值运算符 标签:second [] seconds and enter scanner import system system.in 原文地址:https://www.cnblogs.com/leo2li/p/9626629.html
public class DisplayTime {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter an integer for seconds: ");
int seconds = input.nextInt();
int minutes = seconds / 60 ;
int remainingSeconds = seconds % 60;
System.out.println(seconds + " seconds is " + minutes + " minutes and " + remainingSeconds + " seconds");
}