初学Java 数值运算符

2021-07-03 05:04

阅读:531

标签:second   []   seconds   and   enter   scanner   import   system   system.in   

import java.util.Scanner;
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");
}

}

初学Java 数值运算符

标签:second   []   seconds   and   enter   scanner   import   system   system.in   

原文地址:https://www.cnblogs.com/leo2li/p/9626629.html


评论


亲,登录后才可以留言!