Add all the A tasks
This commit is contained in:
parent
2dd7375f96
commit
051504d65b
1608 changed files with 18584 additions and 0 deletions
|
|
@ -0,0 +1,11 @@
|
|||
interface IntToVoid {
|
||||
void run(int x);
|
||||
}
|
||||
|
||||
for (int z : myIntArray) {
|
||||
new IntToVoid() {
|
||||
public void run(int x) {
|
||||
System.out.println(x);
|
||||
}
|
||||
}.run(z);
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
interface IntToInt {
|
||||
int run(int x);
|
||||
}
|
||||
|
||||
int[] result = new int[myIntArray.length];
|
||||
for (int i = 0; i < myIntArray.length; i++) {
|
||||
result[i] =
|
||||
new IntToInt() {
|
||||
public int run(int x) {
|
||||
return x * x;
|
||||
}
|
||||
}.run(myIntArray[i]);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue