-
Notifications
You must be signed in to change notification settings - Fork 0
/
013.cbl
52 lines (47 loc) · 2.71 KB
/
013.cbl
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
IDENTIFICATION DIVISION.
PROGRAM-ID. Euler013.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 res PIC 9(18) COMP VALUE 0.
01 out PIC Z(10).
PROCEDURE DIVISION.
COMPUTE res = 371072875339 + 463769376774 + 743249861995 +
919422133635 + 230675882075 + 892616706966 +
281128798128 + 442742289174 + 474514457360 +
703864861058 + 621764571418 + 649063524627 +
925758677183 + 582035653253 + 801811993848 +
353986643728 + 865155060062 + 716938887077 +
543700705768 + 532826541087 + 361232725250 +
458765761724 + 174237069058 + 811426604180 +
519343254517 + 624672216484 + 157324443869 +
550376875256 + 183363848253 + 803862875928 +
781828337579 + 167263201004 + 484030981290 +
870869875513 + 599594068957 + 697939506796 +
410526847082 + 653786073615 + 358290353174 +
949537597651 + 889028025717 + 252676802760 +
362702185404 + 240744869082 + 914302881971 +
344130655780 + 230530811728 + 114876969321 +
637832994906 + 677201869716 + 955482553002 +
760853271322 + 377742425354 + 237019132757 +
297988602722 + 184957014548 + 382982037830 +
348295438291 + 409579530664 + 297461521855 +
416981162220 + 624679571944 + 231897067725 +
861880882258 + 113067397083 + 829591747671 +
976233310448 + 428462801835 + 551216035469 +
322381957343 + 755061649651 + 621778427521 +
329241857071 + 995186714302 + 732674608005 +
768418225246 + 971426179103 + 877836461827 +
108488025216 + 713296124747 + 621840735723 +
666278919814 + 606618262936 + 857869440895 +
660243964099 + 649139826800 + 167309393198 +
948093772450 + 786391670211 + 153687137119 +
407899231155 + 448899115014 + 415031288803 +
812348806732 + 826165707739 + 229188020587 +
771585425020 + 721078384350 + 208496039801 +
535035342264
PERFORM UNTIL res < 10000000000
DIVIDE res BY 10 giving res
END-PERFORM
MOVE res TO out
DISPLAY FUNCTION TRIM (out)
STOP RUN.