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 1010 using java · liuchuo/PAT@55bacb0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • BasicLevel_Java
    • 1010. 一元多项式求导 (25).java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎BasicLevel_Java/1010. 一元多项式求导 (25).java‎

Copy file name to clipboard
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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 flag = 0;
7+
while (in.hasNext()) {
8+
int x = in.nextInt();
9+
int n = in.nextInt();
10+
if (n != 0) {
11+
if (flag == 0) {
12+
System.out.print(x * n);
13+
} else {
14+
System.out.print(" " + x * n);
15+
}
16+
System.out.print(" " + (n - 1));
17+
flag = 1;
18+
}
19+
}
20+
if (flag == 0) {
21+
System.out.print("0 0");
22+
}
23+
}
24+
}

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.