public class Problem12 { public static void main(String[] args) { int [] array = new int [501]; long trinumber = 0; int j; for(int i = 1;; i ++){ j = 0; for(int k = 1; k<=trinumber;k++){ if (trinumber%k == 0) {array[j] = k; j++;} } if (array[500] !=0) {System.out.println(trinumber); return;} trinumber+=i; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)