-
Notifications
You must be signed in to change notification settings - Fork 0
/
testing.java
33 lines (30 loc) · 2.95 KB
/
testing.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.*;
public class testing{
int solve(int n)
{
int sol[n];
int k;
for(int i=1,k=0;i<n&&k<n;i++,k++)
{
if(n%i!=0)
sol[k]=i;
}
for(int i=0;i<n;i++)
{
printf(sol[i]);
return 0;
}
public static void main(String[] args) {
int n=749;
int expected[]={748,747,746,745,744,743,741,740,739,738,737,736,734,733,732,731,730,729,727,726,725,724,723,722,720,719,718,717,716,715,713,712,711,710,709,708,706,705,704,703,702,701,699,698,697,696,695,694,692,691,690,689,688,687,685,684,683,682,681,680,678,677,676,675,674,673,671,670,669,668,667,666,664,663,662,661,660,659,657,656,655,654,653,652,650,649,648,647,646,645,643,641,640,639,638,636,635,634,633,632,631,629,628,627,626,625,624,622,621,620,619,618,617,615,614,613,612,611,610,608,607,606,605,604,603,601,600,599,598,597,596,594,593,592,591,590,589,587,586,585,584,583,582,580,579,578,577,576,575,573,572,571,570,569,568,566,565,564,563,562,561,559,558,557,556,555,554,552,551,550,549,548,547,545,544,543,542,541,540,538,537,536,534,533,531,530,529,528,527,526,524,523,522,521,520,519,517,516,515,514,513,512,510,509,508,507,506,505,503,502,501,500,499,498,496,495,494,493,492,491,489,488,487,486,485,484,482,481,480,479,478,477,475,474,473,472,471,470,468,467,466,465,464,463,461,460,459,458,457,456,454,453,452,451,450,449,447,446,445,444,443,442,440,439,438,437,436,435,433,432,431,430,429,426,425,424,423,422,421,419,418,417,416,415,414,412,411,410,409,408,407,405,404,403,402,401,400,398,397,396,395,394,393,391,390,389,388,387,386,384,383,382,381,380,379,377,376,375,374,373,372,370,369,368,367,366,365,363,362,361,360,359,358,356,355,354,353,352,351,349,348,347,346,345,344,342,341,340,339,338,337,335,334,333,332,331,330,328,327,326,325,324,323,320,319,318,317,316,314,313,312,311,310,309,307,306,305,304,303,302,300,299,298,297,296,295,293,292,291,290,289,288,286,285,284,283,282,281,279,278,277,276,275,274,272,271,270,269,268,267,265,264,263,262,261,260,258,257,256,255,254,253,251,250,249,248,247,246,244,243,242,241,240,239,237,236,235,234,233,232,230,229,228,227,226,225,223,222,221,220,219,218,216,215,213,212,211,209,208,207,206,205,204,202,201,200,199,198,197,195,194,193,192,191,190,188,187,186,185,184,183,181,180,179,178,177,176,174,173,172,171,170,169,167,166,165,164,163,162,160,159,158,157,156,155,153,152,151,150,149,148,146,145,144,143,142,141,139,138,137,136,135,134,132,131,130,129,128,127,125,124,123,122,121,120,118,117,116,115,114,113,111,110,109,108,106,104,103,102,101,100,99,97,96,95,94,93,92,90,89,88,87,86,85,83,82,81,80,79,78,76,75,74,73,72,71,69,68,67,66,65,64,62,61,60,59,58,57,55,54,53,52,51,50,48,47,46,45,44,43,41,40,39,38,37,36,34,33,32,31,30,29,27,26,25,24,23,22,20,19,18,17,16,15,13,12,11,10,9,8,6,5,4,3,2,1};
if(Arrays.equals(expected,solution(n))){
System.out.println("correct");
}else{
System.out.println("incorrect");
}
}
}