Update hw4 to a newer version.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
This commit is contained in:
parent
07d34c0cd8
commit
b24a264f7e
221 changed files with 846 additions and 746 deletions
13
hw4/hw4programs/abs.oat
Normal file
13
hw4/hw4programs/abs.oat
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
int abs(int x) {
|
||||
if (x < 0) {
|
||||
return -x;
|
||||
} else if (x > 0) {
|
||||
return x;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
int program (int argc, string[] argv) {
|
||||
print_int(abs(10) + abs(-10) + abs(0));
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue