Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Jump-anywhere/C-sharp/jump-anywhere-1.cs
Normal file
11
Task/Jump-anywhere/C-sharp/jump-anywhere-1.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
if (x > 0) goto positive;
|
||||
else goto negative;
|
||||
|
||||
positive:
|
||||
Console.WriteLine("pos\n"); goto both;
|
||||
|
||||
negative:
|
||||
Console.WriteLine("neg\n");
|
||||
|
||||
both:
|
||||
...
|
||||
1
Task/Jump-anywhere/C-sharp/jump-anywhere-2.cs
Normal file
1
Task/Jump-anywhere/C-sharp/jump-anywhere-2.cs
Normal file
|
|
@ -0,0 +1 @@
|
|||
goto (x > 0 ? positive : negative);
|
||||
5
Task/Jump-anywhere/C-sharp/jump-anywhere-3.cs
Normal file
5
Task/Jump-anywhere/C-sharp/jump-anywhere-3.cs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
for (i = 0; ...) {
|
||||
for (j = 0; ...) {
|
||||
if (condition_met) goto finish;
|
||||
}
|
||||
}
|
||||
5
Task/Jump-anywhere/C-sharp/jump-anywhere-4.cs
Normal file
5
Task/Jump-anywhere/C-sharp/jump-anywhere-4.cs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
goto danger;
|
||||
for (i = 0; i < 10; i++) {
|
||||
danger:
|
||||
Console.WriteLine(i);
|
||||
}
|
||||
12
Task/Jump-anywhere/C-sharp/jump-anywhere-5.cs
Normal file
12
Task/Jump-anywhere/C-sharp/jump-anywhere-5.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
int i = 0;
|
||||
tryAgain:
|
||||
try {
|
||||
i++;
|
||||
if (i < 10) goto tryAgain;
|
||||
}
|
||||
catch {
|
||||
goto tryAgain;
|
||||
}
|
||||
finally {
|
||||
//goto end; //Error
|
||||
}
|
||||
15
Task/Jump-anywhere/C-sharp/jump-anywhere-6.cs
Normal file
15
Task/Jump-anywhere/C-sharp/jump-anywhere-6.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
public int M(int n) {
|
||||
int result = 0;
|
||||
switch (n) {
|
||||
case 1:
|
||||
cost += 25;
|
||||
break;
|
||||
case 2:
|
||||
cost += 25;
|
||||
goto case 1;
|
||||
case 3:
|
||||
cost += 50;
|
||||
goto case 1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue