Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "euler.st"
- "Program pro priklad z eulera, zjistovani delitelneho cisla."
- Number extend [
- isDivisibleBy: aNumber [
- ^(self\\aNumber = 0).
- ]
- ]
- 1 to: (11*12*13*14*15*16*17*18*19*20) do: [ :x |
- | isDividible pocitadlo |
- isDivisible := true.
- pocitadlo := 11.
- [pocitadlo <= 20] whileTrue:
- [
- (x isDivisibleBy: pocitadlo) ifFalse: [
- isDivisible := false.
- pocitadlo := 20.
- ].
- pocitadlo := pocitadlo + 1.
- ].
- (isDivisible) ifTrue: [
- Transcript show: 'Cislo je: ', x printString; cr.
- ].
- ].
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement