-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0552f87
commit 01cc8a5
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
PROGRAM EUCLID1 | ||
c Algorytm Euklidesa w jezyku Fortran 77 | ||
|
||
WRITE (*,*) 'Podaj dwie liczby calkowite: ' | ||
READ (*,*) N, M | ||
|
||
DO WHILE ( N .NE. M ) | ||
IF ( N .GT. M ) THEN | ||
N = N - M | ||
ELSE | ||
M = M - N | ||
ENDIF | ||
ENDDO | ||
WRITE (*,*) 'NWD=', N | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
program NWD(input,output); | ||
{ Algorytm Euklidesa. } | ||
var | ||
A, B : Integer; | ||
begin | ||
Writeln('Podaj dwie liczby calkowite: '); | ||
Readln(a,b); | ||
|
||
while a <> b do | ||
begin | ||
if a > b then a := a - b | ||
else b := b - a; | ||
end; | ||
Writeln('NWD = ', a); | ||
end. | ||
|