【java/算法/组合】从1,2,3,......,100这一百个数中,任取两个数,使其能被4整除的取法有几种?并用程序列举出来。

【数学解法】

100个数应该分成以下四类:

4n+1类:1,5,9,13,......,97  共25个;

4n+2类:2,4,6,10,......,98  共25个;

4n+3类:3,7,11,15,......,99  共25个;

4n+4类:4,8,12,16,......,100  共25个;

如果两个数都从4n+2类或是4n+4类中去,两数和无疑能被4整除,这两个类别的数量是2*C25_2=2*25*24/2/1=600个;

如果一个数从4n+1类取,一个数从4n+3类取,两数和也能被4整除,这个类别的数量是25*25=625种;

三类合计为1225种。

以上为数学解法,只能把种类数算出来,可以为下面的程序算法提供印证。

【程序解法】

HandredDevideFour类:

package test230425;

import java.util.List;

public class HandredDevideFour {
    public static void main(String[] args) {
        int[] arr=new int[100];
        for(int i=1;i<=100;i++) {
            arr[i-1]=i;
        }
        
        Combination c=new Combination(arr,2);
        List<List<Integer>> results=c.getResults();
        
        int idx=0;
        for(List<Integer> res:results) {
            int first=res.get(0);
            int second=res.get(1);
            int sum=first+second;
            
            if(sum%4==0) {
                System.out.println(String.format("%02d", ++idx) +"."+res);
            }
        }
    }
}

Combination类:

import java.util.ArrayList;
import java.util.List;
import java.util.Stack;

/**
 * 数学中排列组合中的组合器实现
 * 
 */
public class Combination {
    /**
     * 用于存放中间结果
     */
    private Stack<Integer> stack;
    
    /**
     * 用于存放结果
     */
    private List<List<Integer>> results;
    
    /**
     * 构造函数
     * @param arr 进行组合的元素
     * @param count 选多少个
     */
    public Combination(int[] arr,int count) {
        if(count>arr.length) {
            throw new ArrayIndexOutOfBoundsException(count+">"+arr.length);
        }
        
        stack = new Stack<>();
        results=new ArrayList<>();
        doSelect(arr,count,0,0);
    }
    
    /**
     * 进行选择
     * @param arr 目标数组
     * @param expect 期望选择数量
     * @param actual 实际选择数量
     * @param current 当前下标
     */
    private void doSelect(int[] arr, int expect, int actual, int current) {
        if(actual == expect) {
            List<Integer> list=new ArrayList<>();
            
            for(int i:stack) {
                list.add(i);
            }
            
            results.add(list);
            
            return;
        }
         
        for(int i=current;i<arr.length;i++) {
            if(!stack.contains(arr[i])) {
                stack.add(arr[i]);
                doSelect(arr, expect, actual+1, i);
                stack.pop();
            }
        }
    }
    
    /**
     * 取得组合结果
     * @return
     */
    public List<List<Integer>> getResults(){
        return results;
    }
    
    /**
     * 测试
     * @param args
     */
    public static void main(String[] args) {
        final int[] arr= {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};
        final int count=2;
        
        Combination c=new Combination(arr,count);
        List<List<Integer>> results=c.getResults();
        
        int idx=0;
        for(List<Integer> res:results) {
            System.out.println(String.format("%02d", ++idx) +"."+res);
        }
    }
}

【输出结果】

01.[1, 3]
02.[1, 7]
03.[1, 11]
04.[1, 15]
05.[1, 19]
06.[1, 23]
07.[1, 27]
08.[1, 31]
09.[1, 35]
10.[1, 39]
11.[1, 43]
12.[1, 47]
13.[1, 51]
14.[1, 55]
15.[1, 59]
16.[1, 63]
17.[1, 67]
18.[1, 71]
19.[1, 75]
20.[1, 79]
21.[1, 83]
22.[1, 87]
23.[1, 91]
24.[1, 95]
25.[1, 99]
26.[2, 6]
27.[2, 10]
28.[2, 14]
29.[2, 18]
30.[2, 22]
31.[2, 26]
32.[2, 30]
33.[2, 34]
34.[2, 38]
35.[2, 42]
36.[2, 46]
37.[2, 50]
38.[2, 54]
39.[2, 58]
40.[2, 62]
41.[2, 66]
42.[2, 70]
43.[2, 74]
44.[2, 78]
45.[2, 82]
46.[2, 86]
47.[2, 90]
48.[2, 94]
49.[2, 98]
50.[3, 5]
51.[3, 9]
52.[3, 13]
53.[3, 17]
54.[3, 21]
55.[3, 25]
56.[3, 29]
57.[3, 33]
58.[3, 37]
59.[3, 41]
60.[3, 45]
61.[3, 49]
62.[3, 53]
63.[3, 57]
64.[3, 61]
65.[3, 65]
66.[3, 69]
67.[3, 73]
68.[3, 77]
69.[3, 81]
70.[3, 85]
71.[3, 89]
72.[3, 93]
73.[3, 97]
74.[4, 8]
75.[4, 12]
76.[4, 16]
77.[4, 20]
78.[4, 24]
79.[4, 28]
80.[4, 32]
81.[4, 36]
82.[4, 40]
83.[4, 44]
84.[4, 48]
85.[4, 52]
86.[4, 56]
87.[4, 60]
88.[4, 64]
89.[4, 68]
90.[4, 72]
91.[4, 76]
92.[4, 80]
93.[4, 84]
94.[4, 88]
95.[4, 92]
96.[4, 96]
97.[4, 100]
98.[5, 7]
99.[5, 11]
100.[5, 15]
101.[5, 19]
102.[5, 23]
103.[5, 27]
104.[5, 31]
105.[5, 35]
106.[5, 39]
107.[5, 43]
108.[5, 47]
109.[5, 51]
110.[5, 55]
111.[5, 59]
112.[5, 63]
113.[5, 67]
114.[5, 71]
115.[5, 75]
116.[5, 79]
117.[5, 83]
118.[5, 87]
119.[5, 91]
120.[5, 95]
121.[5, 99]
122.[6, 10]
123.[6, 14]
124.[6, 18]
125.[6, 22]
126.[6, 26]
127.[6, 30]
128.[6, 34]
129.[6, 38]
130.[6, 42]
131.[6, 46]
132.[6, 50]
133.[6, 54]
134.[6, 58]
135.[6, 62]
136.[6, 66]
137.[6, 70]
138.[6, 74]
139.[6, 78]
140.[6, 82]
141.[6, 86]
142.[6, 90]
143.[6, 94]
144.[6, 98]
145.[7, 9]
146.[7, 13]
147.[7, 17]
148.[7, 21]
149.[7, 25]
150.[7, 29]
151.[7, 33]
152.[7, 37]
153.[7, 41]
154.[7, 45]
155.[7, 49]
156.[7, 53]
157.[7, 57]
158.[7, 61]
159.[7, 65]
160.[7, 69]
161.[7, 73]
162.[7, 77]
163.[7, 81]
164.[7, 85]
165.[7, 89]
166.[7, 93]
167.[7, 97]
168.[8, 12]
169.[8, 16]
170.[8, 20]
171.[8, 24]
172.[8, 28]
173.[8, 32]
174.[8, 36]
175.[8, 40]
176.[8, 44]
177.[8, 48]
178.[8, 52]
179.[8, 56]
180.[8, 60]
181.[8, 64]
182.[8, 68]
183.[8, 72]
184.[8, 76]
185.[8, 80]
186.[8, 84]
187.[8, 88]
188.[8, 92]
189.[8, 96]
190.[8, 100]
191.[9, 11]
192.[9, 15]
193.[9, 19]
194.[9, 23]
195.[9, 27]
196.[9, 31]
197.[9, 35]
198.[9, 39]
199.[9, 43]
200.[9, 47]
201.[9, 51]
202.[9, 55]
203.[9, 59]
204.[9, 63]
205.[9, 67]
206.[9, 71]
207.[9, 75]
208.[9, 79]
209.[9, 83]
210.[9, 87]
211.[9, 91]
212.[9, 95]
213.[9, 99]
214.[10, 14]
215.[10, 18]
216.[10, 22]
217.[10, 26]
218.[10, 30]
219.[10, 34]
220.[10, 38]
221.[10, 42]
222.[10, 46]
223.[10, 50]
224.[10, 54]
225.[10, 58]
226.[10, 62]
227.[10, 66]
228.[10, 70]
229.[10, 74]
230.[10, 78]
231.[10, 82]
232.[10, 86]
233.[10, 90]
234.[10, 94]
235.[10, 98]
236.[11, 13]
237.[11, 17]
238.[11, 21]
239.[11, 25]
240.[11, 29]
241.[11, 33]
242.[11, 37]
243.[11, 41]
244.[11, 45]
245.[11, 49]
246.[11, 53]
247.[11, 57]
248.[11, 61]
249.[11, 65]
250.[11, 69]
251.[11, 73]
252.[11, 77]
253.[11, 81]
254.[11, 85]
255.[11, 89]
256.[11, 93]
257.[11, 97]
258.[12, 16]
259.[12, 20]
260.[12, 24]
261.[12, 28]
262.[12, 32]
263.[12, 36]
264.[12, 40]
265.[12, 44]
266.[12, 48]
267.[12, 52]
268.[12, 56]
269.[12, 60]
270.[12, 64]
271.[12, 68]
272.[12, 72]
273.[12, 76]
274.[12, 80]
275.[12, 84]
276.[12, 88]
277.[12, 92]
278.[12, 96]
279.[12, 100]
280.[13, 15]
281.[13, 19]
282.[13, 23]
283.[13, 27]
284.[13, 31]
285.[13, 35]
286.[13, 39]
287.[13, 43]
288.[13, 47]
289.[13, 51]
290.[13, 55]
291.[13, 59]
292.[13, 63]
293.[13, 67]
294.[13, 71]
295.[13, 75]
296.[13, 79]
297.[13, 83]
298.[13, 87]
299.[13, 91]
300.[13, 95]
301.[13, 99]
302.[14, 18]
303.[14, 22]
304.[14, 26]
305.[14, 30]
306.[14, 34]
307.[14, 38]
308.[14, 42]
309.[14, 46]
310.[14, 50]
311.[14, 54]
312.[14, 58]
313.[14, 62]
314.[14, 66]
315.[14, 70]
316.[14, 74]
317.[14, 78]
318.[14, 82]
319.[14, 86]
320.[14, 90]
321.[14, 94]
322.[14, 98]
323.[15, 17]
324.[15, 21]
325.[15, 25]
326.[15, 29]
327.[15, 33]
328.[15, 37]
329.[15, 41]
330.[15, 45]
331.[15, 49]
332.[15, 53]
333.[15, 57]
334.[15, 61]
335.[15, 65]
336.[15, 69]
337.[15, 73]
338.[15, 77]
339.[15, 81]
340.[15, 85]
341.[15, 89]
342.[15, 93]
343.[15, 97]
344.[16, 20]
345.[16, 24]
346.[16, 28]
347.[16, 32]
348.[16, 36]
349.[16, 40]
350.[16, 44]
351.[16, 48]
352.[16, 52]
353.[16, 56]
354.[16, 60]
355.[16, 64]
356.[16, 68]
357.[16, 72]
358.[16, 76]
359.[16, 80]
360.[16, 84]
361.[16, 88]
362.[16, 92]
363.[16, 96]
364.[16, 100]
365.[17, 19]
366.[17, 23]
367.[17, 27]
368.[17, 31]
369.[17, 35]
370.[17, 39]
371.[17, 43]
372.[17, 47]
373.[17, 51]
374.[17, 55]
375.[17, 59]
376.[17, 63]
377.[17, 67]
378.[17, 71]
379.[17, 75]
380.[17, 79]
381.[17, 83]
382.[17, 87]
383.[17, 91]
384.[17, 95]
385.[17, 99]
386.[18, 22]
387.[18, 26]
388.[18, 30]
389.[18, 34]
390.[18, 38]
391.[18, 42]
392.[18, 46]
393.[18, 50]
394.[18, 54]
395.[18, 58]
396.[18, 62]
397.[18, 66]
398.[18, 70]
399.[18, 74]
400.[18, 78]
401.[18, 82]
402.[18, 86]
403.[18, 90]
404.[18, 94]
405.[18, 98]
406.[19, 21]
407.[19, 25]
408.[19, 29]
409.[19, 33]
410.[19, 37]
411.[19, 41]
412.[19, 45]
413.[19, 49]
414.[19, 53]
415.[19, 57]
416.[19, 61]
417.[19, 65]
418.[19, 69]
419.[19, 73]
420.[19, 77]
421.[19, 81]
422.[19, 85]
423.[19, 89]
424.[19, 93]
425.[19, 97]
426.[20, 24]
427.[20, 28]
428.[20, 32]
429.[20, 36]
430.[20, 40]
431.[20, 44]
432.[20, 48]
433.[20, 52]
434.[20, 56]
435.[20, 60]
436.[20, 64]
437.[20, 68]
438.[20, 72]
439.[20, 76]
440.[20, 80]
441.[20, 84]
442.[20, 88]
443.[20, 92]
444.[20, 96]
445.[20, 100]
446.[21, 23]
447.[21, 27]
448.[21, 31]
449.[21, 35]
450.[21, 39]
451.[21, 43]
452.[21, 47]
453.[21, 51]
454.[21, 55]
455.[21, 59]
456.[21, 63]
457.[21, 67]
458.[21, 71]
459.[21, 75]
460.[21, 79]
461.[21, 83]
462.[21, 87]
463.[21, 91]
464.[21, 95]
465.[21, 99]
466.[22, 26]
467.[22, 30]
468.[22, 34]
469.[22, 38]
470.[22, 42]
471.[22, 46]
472.[22, 50]
473.[22, 54]
474.[22, 58]
475.[22, 62]
476.[22, 66]
477.[22, 70]
478.[22, 74]
479.[22, 78]
480.[22, 82]
481.[22, 86]
482.[22, 90]
483.[22, 94]
484.[22, 98]
485.[23, 25]
486.[23, 29]
487.[23, 33]
488.[23, 37]
489.[23, 41]
490.[23, 45]
491.[23, 49]
492.[23, 53]
493.[23, 57]
494.[23, 61]
495.[23, 65]
496.[23, 69]
497.[23, 73]
498.[23, 77]
499.[23, 81]
500.[23, 85]
501.[23, 89]
502.[23, 93]
503.[23, 97]
504.[24, 28]
505.[24, 32]
506.[24, 36]
507.[24, 40]
508.[24, 44]
509.[24, 48]
510.[24, 52]
511.[24, 56]
512.[24, 60]
513.[24, 64]
514.[24, 68]
515.[24, 72]
516.[24, 76]
517.[24, 80]
518.[24, 84]
519.[24, 88]
520.[24, 92]
521.[24, 96]
522.[24, 100]
523.[25, 27]
524.[25, 31]
525.[25, 35]
526.[25, 39]
527.[25, 43]
528.[25, 47]
529.[25, 51]
530.[25, 55]
531.[25, 59]
532.[25, 63]
533.[25, 67]
534.[25, 71]
535.[25, 75]
536.[25, 79]
537.[25, 83]
538.[25, 87]
539.[25, 91]
540.[25, 95]
541.[25, 99]
542.[26, 30]
543.[26, 34]
544.[26, 38]
545.[26, 42]
546.[26, 46]
547.[26, 50]
548.[26, 54]
549.[26, 58]
550.[26, 62]
551.[26, 66]
552.[26, 70]
553.[26, 74]
554.[26, 78]
555.[26, 82]
556.[26, 86]
557.[26, 90]
558.[26, 94]
559.[26, 98]
560.[27, 29]
561.[27, 33]
562.[27, 37]
563.[27, 41]
564.[27, 45]
565.[27, 49]
566.[27, 53]
567.[27, 57]
568.[27, 61]
569.[27, 65]
570.[27, 69]
571.[27, 73]
572.[27, 77]
573.[27, 81]
574.[27, 85]
575.[27, 89]
576.[27, 93]
577.[27, 97]
578.[28, 32]
579.[28, 36]
580.[28, 40]
581.[28, 44]
582.[28, 48]
583.[28, 52]
584.[28, 56]
585.[28, 60]
586.[28, 64]
587.[28, 68]
588.[28, 72]
589.[28, 76]
590.[28, 80]
591.[28, 84]
592.[28, 88]
593.[28, 92]
594.[28, 96]
595.[28, 100]
596.[29, 31]
597.[29, 35]
598.[29, 39]
599.[29, 43]
600.[29, 47]
601.[29, 51]
602.[29, 55]
603.[29, 59]
604.[29, 63]
605.[29, 67]
606.[29, 71]
607.[29, 75]
608.[29, 79]
609.[29, 83]
610.[29, 87]
611.[29, 91]
612.[29, 95]
613.[29, 99]
614.[30, 34]
615.[30, 38]
616.[30, 42]
617.[30, 46]
618.[30, 50]
619.[30, 54]
620.[30, 58]
621.[30, 62]
622.[30, 66]
623.[30, 70]
624.[30, 74]
625.[30, 78]
626.[30, 82]
627.[30, 86]
628.[30, 90]
629.[30, 94]
630.[30, 98]
631.[31, 33]
632.[31, 37]
633.[31, 41]
634.[31, 45]
635.[31, 49]
636.[31, 53]
637.[31, 57]
638.[31, 61]
639.[31, 65]
640.[31, 69]
641.[31, 73]
642.[31, 77]
643.[31, 81]
644.[31, 85]
645.[31, 89]
646.[31, 93]
647.[31, 97]
648.[32, 36]
649.[32, 40]
650.[32, 44]
651.[32, 48]
652.[32, 52]
653.[32, 56]
654.[32, 60]
655.[32, 64]
656.[32, 68]
657.[32, 72]
658.[32, 76]
659.[32, 80]
660.[32, 84]
661.[32, 88]
662.[32, 92]
663.[32, 96]
664.[32, 100]
665.[33, 35]
666.[33, 39]
667.[33, 43]
668.[33, 47]
669.[33, 51]
670.[33, 55]
671.[33, 59]
672.[33, 63]
673.[33, 67]
674.[33, 71]
675.[33, 75]
676.[33, 79]
677.[33, 83]
678.[33, 87]
679.[33, 91]
680.[33, 95]
681.[33, 99]
682.[34, 38]
683.[34, 42]
684.[34, 46]
685.[34, 50]
686.[34, 54]
687.[34, 58]
688.[34, 62]
689.[34, 66]
690.[34, 70]
691.[34, 74]
692.[34, 78]
693.[34, 82]
694.[34, 86]
695.[34, 90]
696.[34, 94]
697.[34, 98]
698.[35, 37]
699.[35, 41]
700.[35, 45]
701.[35, 49]
702.[35, 53]
703.[35, 57]
704.[35, 61]
705.[35, 65]
706.[35, 69]
707.[35, 73]
708.[35, 77]
709.[35, 81]
710.[35, 85]
711.[35, 89]
712.[35, 93]
713.[35, 97]
714.[36, 40]
715.[36, 44]
716.[36, 48]
717.[36, 52]
718.[36, 56]
719.[36, 60]
720.[36, 64]
721.[36, 68]
722.[36, 72]
723.[36, 76]
724.[36, 80]
725.[36, 84]
726.[36, 88]
727.[36, 92]
728.[36, 96]
729.[36, 100]
730.[37, 39]
731.[37, 43]
732.[37, 47]
733.[37, 51]
734.[37, 55]
735.[37, 59]
736.[37, 63]
737.[37, 67]
738.[37, 71]
739.[37, 75]
740.[37, 79]
741.[37, 83]
742.[37, 87]
743.[37, 91]
744.[37, 95]
745.[37, 99]
746.[38, 42]
747.[38, 46]
748.[38, 50]
749.[38, 54]
750.[38, 58]
751.[38, 62]
752.[38, 66]
753.[38, 70]
754.[38, 74]
755.[38, 78]
756.[38, 82]
757.[38, 86]
758.[38, 90]
759.[38, 94]
760.[38, 98]
761.[39, 41]
762.[39, 45]
763.[39, 49]
764.[39, 53]
765.[39, 57]
766.[39, 61]
767.[39, 65]
768.[39, 69]
769.[39, 73]
770.[39, 77]
771.[39, 81]
772.[39, 85]
773.[39, 89]
774.[39, 93]
775.[39, 97]
776.[40, 44]
777.[40, 48]
778.[40, 52]
779.[40, 56]
780.[40, 60]
781.[40, 64]
782.[40, 68]
783.[40, 72]
784.[40, 76]
785.[40, 80]
786.[40, 84]
787.[40, 88]
788.[40, 92]
789.[40, 96]
790.[40, 100]
791.[41, 43]
792.[41, 47]
793.[41, 51]
794.[41, 55]
795.[41, 59]
796.[41, 63]
797.[41, 67]
798.[41, 71]
799.[41, 75]
800.[41, 79]
801.[41, 83]
802.[41, 87]
803.[41, 91]
804.[41, 95]
805.[41, 99]
806.[42, 46]
807.[42, 50]
808.[42, 54]
809.[42, 58]
810.[42, 62]
811.[42, 66]
812.[42, 70]
813.[42, 74]
814.[42, 78]
815.[42, 82]
816.[42, 86]
817.[42, 90]
818.[42, 94]
819.[42, 98]
820.[43, 45]
821.[43, 49]
822.[43, 53]
823.[43, 57]
824.[43, 61]
825.[43, 65]
826.[43, 69]
827.[43, 73]
828.[43, 77]
829.[43, 81]
830.[43, 85]
831.[43, 89]
832.[43, 93]
833.[43, 97]
834.[44, 48]
835.[44, 52]
836.[44, 56]
837.[44, 60]
838.[44, 64]
839.[44, 68]
840.[44, 72]
841.[44, 76]
842.[44, 80]
843.[44, 84]
844.[44, 88]
845.[44, 92]
846.[44, 96]
847.[44, 100]
848.[45, 47]
849.[45, 51]
850.[45, 55]
851.[45, 59]
852.[45, 63]
853.[45, 67]
854.[45, 71]
855.[45, 75]
856.[45, 79]
857.[45, 83]
858.[45, 87]
859.[45, 91]
860.[45, 95]
861.[45, 99]
862.[46, 50]
863.[46, 54]
864.[46, 58]
865.[46, 62]
866.[46, 66]
867.[46, 70]
868.[46, 74]
869.[46, 78]
870.[46, 82]
871.[46, 86]
872.[46, 90]
873.[46, 94]
874.[46, 98]
875.[47, 49]
876.[47, 53]
877.[47, 57]
878.[47, 61]
879.[47, 65]
880.[47, 69]
881.[47, 73]
882.[47, 77]
883.[47, 81]
884.[47, 85]
885.[47, 89]
886.[47, 93]
887.[47, 97]
888.[48, 52]
889.[48, 56]
890.[48, 60]
891.[48, 64]
892.[48, 68]
893.[48, 72]
894.[48, 76]
895.[48, 80]
896.[48, 84]
897.[48, 88]
898.[48, 92]
899.[48, 96]
900.[48, 100]
901.[49, 51]
902.[49, 55]
903.[49, 59]
904.[49, 63]
905.[49, 67]
906.[49, 71]
907.[49, 75]
908.[49, 79]
909.[49, 83]
910.[49, 87]
911.[49, 91]
912.[49, 95]
913.[49, 99]
914.[50, 54]
915.[50, 58]
916.[50, 62]
917.[50, 66]
918.[50, 70]
919.[50, 74]
920.[50, 78]
921.[50, 82]
922.[50, 86]
923.[50, 90]
924.[50, 94]
925.[50, 98]
926.[51, 53]
927.[51, 57]
928.[51, 61]
929.[51, 65]
930.[51, 69]
931.[51, 73]
932.[51, 77]
933.[51, 81]
934.[51, 85]
935.[51, 89]
936.[51, 93]
937.[51, 97]
938.[52, 56]
939.[52, 60]
940.[52, 64]
941.[52, 68]
942.[52, 72]
943.[52, 76]
944.[52, 80]
945.[52, 84]
946.[52, 88]
947.[52, 92]
948.[52, 96]
949.[52, 100]
950.[53, 55]
951.[53, 59]
952.[53, 63]
953.[53, 67]
954.[53, 71]
955.[53, 75]
956.[53, 79]
957.[53, 83]
958.[53, 87]
959.[53, 91]
960.[53, 95]
961.[53, 99]
962.[54, 58]
963.[54, 62]
964.[54, 66]
965.[54, 70]
966.[54, 74]
967.[54, 78]
968.[54, 82]
969.[54, 86]
970.[54, 90]
971.[54, 94]
972.[54, 98]
973.[55, 57]
974.[55, 61]
975.[55, 65]
976.[55, 69]
977.[55, 73]
978.[55, 77]
979.[55, 81]
980.[55, 85]
981.[55, 89]
982.[55, 93]
983.[55, 97]
984.[56, 60]
985.[56, 64]
986.[56, 68]
987.[56, 72]
988.[56, 76]
989.[56, 80]
990.[56, 84]
991.[56, 88]
992.[56, 92]
993.[56, 96]
994.[56, 100]
995.[57, 59]
996.[57, 63]
997.[57, 67]
998.[57, 71]
999.[57, 75]
1000.[57, 79]
1001.[57, 83]
1002.[57, 87]
1003.[57, 91]
1004.[57, 95]
1005.[57, 99]
1006.[58, 62]
1007.[58, 66]
1008.[58, 70]
1009.[58, 74]
1010.[58, 78]
1011.[58, 82]
1012.[58, 86]
1013.[58, 90]
1014.[58, 94]
1015.[58, 98]
1016.[59, 61]
1017.[59, 65]
1018.[59, 69]
1019.[59, 73]
1020.[59, 77]
1021.[59, 81]
1022.[59, 85]
1023.[59, 89]
1024.[59, 93]
1025.[59, 97]
1026.[60, 64]
1027.[60, 68]
1028.[60, 72]
1029.[60, 76]
1030.[60, 80]
1031.[60, 84]
1032.[60, 88]
1033.[60, 92]
1034.[60, 96]
1035.[60, 100]
1036.[61, 63]
1037.[61, 67]
1038.[61, 71]
1039.[61, 75]
1040.[61, 79]
1041.[61, 83]
1042.[61, 87]
1043.[61, 91]
1044.[61, 95]
1045.[61, 99]
1046.[62, 66]
1047.[62, 70]
1048.[62, 74]
1049.[62, 78]
1050.[62, 82]
1051.[62, 86]
1052.[62, 90]
1053.[62, 94]
1054.[62, 98]
1055.[63, 65]
1056.[63, 69]
1057.[63, 73]
1058.[63, 77]
1059.[63, 81]
1060.[63, 85]
1061.[63, 89]
1062.[63, 93]
1063.[63, 97]
1064.[64, 68]
1065.[64, 72]
1066.[64, 76]
1067.[64, 80]
1068.[64, 84]
1069.[64, 88]
1070.[64, 92]
1071.[64, 96]
1072.[64, 100]
1073.[65, 67]
1074.[65, 71]
1075.[65, 75]
1076.[65, 79]
1077.[65, 83]
1078.[65, 87]
1079.[65, 91]
1080.[65, 95]
1081.[65, 99]
1082.[66, 70]
1083.[66, 74]
1084.[66, 78]
1085.[66, 82]
1086.[66, 86]
1087.[66, 90]
1088.[66, 94]
1089.[66, 98]
1090.[67, 69]
1091.[67, 73]
1092.[67, 77]
1093.[67, 81]
1094.[67, 85]
1095.[67, 89]
1096.[67, 93]
1097.[67, 97]
1098.[68, 72]
1099.[68, 76]
1100.[68, 80]
1101.[68, 84]
1102.[68, 88]
1103.[68, 92]
1104.[68, 96]
1105.[68, 100]
1106.[69, 71]
1107.[69, 75]
1108.[69, 79]
1109.[69, 83]
1110.[69, 87]
1111.[69, 91]
1112.[69, 95]
1113.[69, 99]
1114.[70, 74]
1115.[70, 78]
1116.[70, 82]
1117.[70, 86]
1118.[70, 90]
1119.[70, 94]
1120.[70, 98]
1121.[71, 73]
1122.[71, 77]
1123.[71, 81]
1124.[71, 85]
1125.[71, 89]
1126.[71, 93]
1127.[71, 97]
1128.[72, 76]
1129.[72, 80]
1130.[72, 84]
1131.[72, 88]
1132.[72, 92]
1133.[72, 96]
1134.[72, 100]
1135.[73, 75]
1136.[73, 79]
1137.[73, 83]
1138.[73, 87]
1139.[73, 91]
1140.[73, 95]
1141.[73, 99]
1142.[74, 78]
1143.[74, 82]
1144.[74, 86]
1145.[74, 90]
1146.[74, 94]
1147.[74, 98]
1148.[75, 77]
1149.[75, 81]
1150.[75, 85]
1151.[75, 89]
1152.[75, 93]
1153.[75, 97]
1154.[76, 80]
1155.[76, 84]
1156.[76, 88]
1157.[76, 92]
1158.[76, 96]
1159.[76, 100]
1160.[77, 79]
1161.[77, 83]
1162.[77, 87]
1163.[77, 91]
1164.[77, 95]
1165.[77, 99]
1166.[78, 82]
1167.[78, 86]
1168.[78, 90]
1169.[78, 94]
1170.[78, 98]
1171.[79, 81]
1172.[79, 85]
1173.[79, 89]
1174.[79, 93]
1175.[79, 97]
1176.[80, 84]
1177.[80, 88]
1178.[80, 92]
1179.[80, 96]
1180.[80, 100]
1181.[81, 83]
1182.[81, 87]
1183.[81, 91]
1184.[81, 95]
1185.[81, 99]
1186.[82, 86]
1187.[82, 90]
1188.[82, 94]
1189.[82, 98]
1190.[83, 85]
1191.[83, 89]
1192.[83, 93]
1193.[83, 97]
1194.[84, 88]
1195.[84, 92]
1196.[84, 96]
1197.[84, 100]
1198.[85, 87]
1199.[85, 91]
1200.[85, 95]
1201.[85, 99]
1202.[86, 90]
1203.[86, 94]
1204.[86, 98]
1205.[87, 89]
1206.[87, 93]
1207.[87, 97]
1208.[88, 92]
1209.[88, 96]
1210.[88, 100]
1211.[89, 91]
1212.[89, 95]
1213.[89, 99]
1214.[90, 94]
1215.[90, 98]
1216.[91, 93]
1217.[91, 97]
1218.[92, 96]
1219.[92, 100]
1220.[93, 95]
1221.[93, 99]
1222.[94, 98]
1223.[95, 97]
1224.[96, 100]
1225.[97, 99]

程序输出和数学计算的结果相互可以印证!

 

END

posted @ 2023-04-25 09:01  逆火狂飙  阅读(123)  评论(0编辑  收藏  举报
生当作人杰 死亦为鬼雄 至今思项羽 不肯过江东