X-Git-Url: http://svarog.pmf.uns.ac.rs/gitweb/?p=mjc2wsl.git;a=blobdiff_plain;f=samples%2Feratos.mj;h=92d28f88b65b66fbbc814aecfde16e997cf7fc1e;hp=620bd2daa1af7fe783cd2fd6adbd5a075b94239d;hb=306587b78e421a7221952e44adde831723748e4c;hpb=6b96ddc43ce994ef402a19b106c283e571d45219;ds=inline diff --git a/samples/eratos.mj b/samples/eratos.mj index 620bd2d..92d28f8 100644 --- a/samples/eratos.mj +++ b/samples/eratos.mj @@ -7,7 +7,11 @@ program Eratos { void put(int x) { - if (npp == 10) {print(chr(13)); print(chr(10)); npp = 0;} + if (npp == 10) { + print(chr(13)); + print(chr(10)); + npp = 0; + } print(x, 5); npp++; } @@ -17,7 +21,9 @@ program Eratos { put(x); i = x; - while (i <= max) {sieve[i] = 'o'; i = i + x;} + while (i <= max) { + sieve[i] = 'o'; i = i + x; + } } void main() @@ -27,11 +33,14 @@ program Eratos npp = 0; sieve = new char[max+1]; i = 0; - while (i <= max) {sieve[i] = 'x'; i++;} + while (i <= max) { + sieve[i] = 'x'; i++; + } i = 2; while (i <= max) { found(i); - while(i <= max && sieve[i] == 'o') i++; + while(i <= max && sieve[i] == 'o') + i++; } }