package countrectsinround; /** *Title: CountRectsInRound
* @author LashaCoder * */ public class MainOperation { int r = 5; int size = 1; int arr[][] = new int[r][r]; int count; public MainOperation() { count(); } private void count(){ for(int i = 1; i <= r; i+=size){ for(int j = 1; j <= r; j+=size){ double c = 0; c = Math.sqrt((i*i+j*j)); if(c <= r){ count++; } } } count*=4; System.out.println("the answer is: "+count); } public static void main(String[] args) { MainOperation mainOperation1 = new MainOperation(); }