Add shadowing example
This commit is contained in:
parent
45c3d5a126
commit
16d8beaab0
31
examples/shadowing/shadowing.mc
Normal file
31
examples/shadowing/shadowing.mc
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
int main()
|
||||||
|
{
|
||||||
|
int x;
|
||||||
|
x = 1;
|
||||||
|
print_int(x);
|
||||||
|
|
||||||
|
{
|
||||||
|
x = 2;
|
||||||
|
print_int(x);
|
||||||
|
|
||||||
|
int x;
|
||||||
|
x = 3;
|
||||||
|
print_int(x);
|
||||||
|
|
||||||
|
{
|
||||||
|
x = 4;
|
||||||
|
print_int(x);
|
||||||
|
|
||||||
|
int x;
|
||||||
|
x = 5;
|
||||||
|
print_int(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
print_int(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
print_int(x);
|
||||||
|
print_nl();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
0
examples/shadowing/shadowing.stdin.txt
Normal file
0
examples/shadowing/shadowing.stdin.txt
Normal file
1
examples/shadowing/shadowing.stdout.txt
Normal file
1
examples/shadowing/shadowing.stdout.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
1234542
|
Loading…
Reference in New Issue
Block a user