GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — :tada: feat: initial commit for 1026 using java · liuchuo/PAT@1933c0b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • BasicLevel_Java
    • 1026. 程序运行时间(15).java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎BasicLevel_Java/1026. 程序运行时间(15).java‎

Copy file name to clipboard
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import java.util.Scanner;
2+
3+
public class Main {
4+
public static void main(String[] args) {
5+
Scanner in = new Scanner(System.in);
6+
int c1 = in.nextInt();
7+
int c2 = in.nextInt();
8+
//考虑四舍五入
9+
int sum = (c2 - c1 + 50) / 100;
10+
int h = sum / 3600;
11+
sum = sum % 3600;
12+
int m = sum / 60;
13+
int s = sum % 60;
14+
System.out.printf("%02d:%02d:%02d", h, m, s);
15+
}
16+
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.