mirror of
https://github.com/Xevion/contest.git
synced 2025-12-16 00:11:23 -06:00
fix q13 incremental ops position, out.println
This commit is contained in:
@@ -171,7 +171,7 @@ What I'm talking about is the `unary operators`, `++` and `--`.
|
|||||||
|
|
||||||
Pre-increment `++x`
|
Pre-increment `++x`
|
||||||
|
|
||||||
Post-increment `y--`
|
Post-increment `y++`
|
||||||
|
|
||||||
Post-decrement `--this.halogen.id`
|
Post-decrement `--this.halogen.id`
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ Pre-increment `dragon.level++`
|
|||||||
```java
|
```java
|
||||||
int x = 3;
|
int x = 3;
|
||||||
int y = 4;
|
int y = 4;
|
||||||
println(++x + ++y + y++)
|
out.println(++x + ++y + y++)
|
||||||
```
|
```
|
||||||
|
|
||||||
The evaluating engine (or whatever) sees a 4 with the pre-increment operator, x is incremented to 4, and returns a 4. Then, y is incremented to 5, and the operator returns a 5.
|
The evaluating engine (or whatever) sees a 4 with the pre-increment operator, x is incremented to 4, and returns a 4. Then, y is incremented to 5, and the operator returns a 5.
|
||||||
|
|||||||
Reference in New Issue
Block a user