Data Structure

quirt some

GOD03219 2018. 2. 13. 11:35

for (int i = 1000; i < 10000; i++) {

 int q = i / 100;

 int r = i % 100;

int result = (q + r) * (q + r);

 if (i == result) System.out.println(i);

 

}


 

 for (int i = 1000; i < 10000; i++) {

 int q = i / 100;

int r = i % 100;

int result = (int) Math.pow(q + r, 2);

if (i == result) System.out.println(i);

}