004-008-001
Multidimensional Array: Weekly Points Table
Easy
Problem Description
Multidimensional Array: Weekly Points Table
Learning Objective: Manage numeric data with 2D array and implement aggregation processing
Manage weekly point card earning records. Create 2D array to record point earnings by combination of day and store (3 stores).
Input
Line 1: Number of days n (1-3)
Following lines: Points for n days (3 stores per day: Store A Store B Store C)
Output
=== Weekly Points ===
Day 1: A:[pt]pt B:[pt]pt C:[pt]pt = [total]pt
Day 2: A:[pt]pt B:[pt]pt C:[pt]pt = [total]pt
...
━━━━━━━━━━━━━━━━
Total: [grand total]pt ([n] days)
```java
## Examples
### Example 1: 2 Days of Points
Input:
```java
2
10 20 30
15 25 35
```java
Output:
```java
=== Weekly Points ===
Day 1: A:10pt B:20pt C:30pt = 60pt
Day 2: A:15pt B:25pt C:35pt = 75pt
━━━━━━━━━━━━━━━━
Total: 135pt (2 days)
Test Cases
※ Output examples follow programming industry standards
Input:
2 10 20 30 15 25 35
Expected Output:
=== Weekly Points === Day 1: A:10pt B:20pt C:30pt = 60pt Day 2: A:15pt B:25pt C:35pt = 75pt ━━━━━━━━━━━━━━━━ Total: 135pt (2 days)
Input:
1 50 40 30
Expected Output:
=== Weekly Points === Day 1: A:50pt B:40pt C:30pt = 120pt ━━━━━━━━━━━━━━━━ Total: 120pt (1 days)
Input:
3 10 10 10 20 20 20 30 30 30
Expected Output:
=== Weekly Points === Day 1: A:10pt B:10pt C:10pt = 30pt Day 2: A:20pt B:20pt C:20pt = 60pt Day 3: A:30pt B:30pt C:30pt = 90pt ━━━━━━━━━━━━━━━━ Total: 180pt (3 days)
❌ Some tests failed
Your Solution
Current Mode:● My Code
99
1
2
3
4
5
6
7
8
9
10
›
⌄
⌄
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here
sc.close();
}
}
0 B / 5 MB
You have 9 free executions remaining
