Jagged-Array Modification (C#)
80/100 Ако някой може да помогне в откриването на грешката?
https://judge.softuni.org/Contests/Practice/Index/1452#5
Jagged-Array Modification
Create a program that reads a matrix from the console. On the first line you will get matrix rows. On next rows lines you will get elements for each column separated with space. You will be receiving commands in the following format:
- Add {row} {col} {value} – Increase the number at the given coordinates with the value.
- Subtract {row} {col} {value} – Decrease the number at the given coordinates by the value.
Coordinates might be invalid. In this case you should print "Invalid coordinates". When you receive "END" you should print the matrix and stop the program.
Examples
Input |
Output |
3 1 2 3 4 5 6 7 8 9 Add 0 0 5 Subtract 1 1 2 END
|
6 2 3 4 3 6 7 8 9 |
4 1 2 3 4 5 6 7 8 8 7 6 5 4 3 2 1 Add 4 4 100 Add 3 3 100 Subtract -1 -1 42 Subtract 0 0 42 END |
Invalid coordinates Invalid coordinates -41 2 3 4 5 6 7 8 8 7 6 5 4 3 2 101 |
Не знам и аз :D Нещо блокирах и мислех, че трябва да обходя всеки вътрешен масив по отделно. Схванах си грешката, мерси :)