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 β€” πŸŽ‰ feat: initial commit for 1046 using java Β· liuchuo/PAT@a5585e8

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • BasicLevel_Java
    • 1046 εˆ’ζ‹³ (15 εˆ†).java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

β€ŽBasicLevel_Java/1046 εˆ’ζ‹³ (15 εˆ†).javaβ€Ž

Copy file name to clipboard
+29Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import java.io.BufferedReader;
2+
import java.io.IOException;
3+
import java.io.InputStreamReader;
4+
5+
public class Main {
6+
public static void main(String[] args) throws IOException {
7+
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
8+
int n = Integer.parseInt(br.readLine());
9+
int j = 0,y = 0;
10+
for (int i = 0; i < n; i++) {
11+
String[] str = br.readLine().split(" ");
12+
boolean jj = false, yy = false;
13+
if (Integer.parseInt(str[0]) + Integer.parseInt(str[2]) == Integer.parseInt(str[1])) {
14+
jj = true;
15+
}
16+
if (Integer.parseInt(str[0]) + Integer.parseInt(str[2]) == Integer.parseInt(str[3])) {
17+
yy = true;
18+
}
19+
if (jj && yy || (!jj && !yy)) {
20+
continue;
21+
}else if (jj) {
22+
j++;
23+
}else {
24+
y++;
25+
}
26+
}
27+
System.out.println(y + " " + j);
28+
}
29+
}

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.