User:Binari: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 37:
i=i/2;
}
}
}
</lang>
 
==Loops/Nested==
<lang java>
/* package whatever; // don't place package name! */
 
import java.util.*;
import java.lang.*;
import java.io.*;
 
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
int i,j;
int[][] ar=new int[20][20];
Random rast=new Random();
for (i=0; i<20; i++) {
for (j=0; j<20; j++) {
ar[i][j]=rast.nextInt(20)+1;
}
}
System.out.println("R C");
for (i=0; i<20; i++) {
for (j=0; j<20; j++) {
if (ar[i][j]==20) {
System.out.println(i+" "+j);
break;
}
}
}
// your code goes here
}
}
Anonymous user