September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
9
Task/Loops-Continue/ALGOL-W/loops-continue.alg
Normal file
9
Task/Loops-Continue/ALGOL-W/loops-continue.alg
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
begin
|
||||
i_w := 1; s_w := 0; % set output format %
|
||||
for i := 1 until 10 do begin
|
||||
writeon( i );
|
||||
if i rem 5 = 0
|
||||
then write()
|
||||
else writeon( ", " )
|
||||
end for_i
|
||||
end.
|
||||
7
Task/Loops-Continue/Agena/loops-continue.agena
Normal file
7
Task/Loops-Continue/Agena/loops-continue.agena
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
for i to 10 do
|
||||
write( i );
|
||||
if i % 5 = 0
|
||||
then write( "\n" )
|
||||
else write( ", " )
|
||||
fi
|
||||
od
|
||||
10
Task/Loops-Continue/BASIC/loops-continue-10.basic
Normal file
10
Task/Loops-Continue/BASIC/loops-continue-10.basic
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
OPTION EXPLICIT
|
||||
|
||||
DIM i AS INTEGER
|
||||
|
||||
CLS
|
||||
FOR i = 1 TO 10
|
||||
PRINT STR$(i);
|
||||
IF (i MOD 5) THEN PRINT ","; ELSE PRINT
|
||||
NEXT i
|
||||
END
|
||||
5
Task/Loops-Continue/BASIC/loops-continue-3.basic
Normal file
5
Task/Loops-Continue/BASIC/loops-continue-3.basic
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
10 FOR I = 1 to 10
|
||||
20 PRINT I;
|
||||
30 IF INT(I/5) = I/5 THEN PRINT : GOTO 50
|
||||
40 PRINT ", ";
|
||||
50 NEXT
|
||||
6
Task/Loops-Continue/BASIC/loops-continue-8.basic
Normal file
6
Task/Loops-Continue/BASIC/loops-continue-8.basic
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
10 FOR I=1 TO 10
|
||||
20 PRINT I;
|
||||
30 IF I/5=INT (I/5) THEN PRINT
|
||||
40 IF I/5=INT (I/5) THEN NEXT I
|
||||
50 PRINT ", ";
|
||||
60 NEXT I
|
||||
9
Task/Loops-Continue/Bc/loops-continue.bc
Normal file
9
Task/Loops-Continue/Bc/loops-continue.bc
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
for (i = 1; i <= 10; i++) {
|
||||
print i
|
||||
if (i % 5) {
|
||||
print ", "
|
||||
continue
|
||||
}
|
||||
print "\n"
|
||||
}
|
||||
quit
|
||||
11
Task/Loops-Continue/Bracmat/loops-continue.bracmat
Normal file
11
Task/Loops-Continue/Bracmat/loops-continue.bracmat
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
( 0:?i
|
||||
& whl
|
||||
' ( 1+!i:~>10:?i
|
||||
& put
|
||||
$ ( str
|
||||
$ ( !i
|
||||
(mod$(!i.5):0&\n|", ")
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
12
Task/Loops-Continue/Dc/loops-continue.dc
Normal file
12
Task/Loops-Continue/Dc/loops-continue.dc
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
1 si # i = 1
|
||||
[2Q]sA # A = code to break loop
|
||||
[[, ]P 1J]sB # B = code to print comma, continue loop
|
||||
[
|
||||
li n # print i
|
||||
li 5 % 0 !=B # call B if i % 5
|
||||
[
|
||||
]P # print newline
|
||||
M # mark from calling B
|
||||
li 1 + si # i += 1
|
||||
li 10!<C # continue loop if 10 >= i
|
||||
]sC li 10!<C # enter loop if 10 >= i
|
||||
10
Task/Loops-Continue/Gambas/loops-continue.gambas
Normal file
10
Task/Loops-Continue/Gambas/loops-continue.gambas
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
Public Sub Main()
|
||||
Dim siCount As Short
|
||||
|
||||
For siCount = 1 To 10
|
||||
Print siCount;
|
||||
If siCount <> 5 And siCount <> 10 Then Print ",";
|
||||
If siCount = 5 Then Print gb.NewLine;
|
||||
Next
|
||||
|
||||
End
|
||||
11
Task/Loops-Continue/Kotlin/loops-continue.kotlin
Normal file
11
Task/Loops-Continue/Kotlin/loops-continue.kotlin
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// version 1.1.2
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
for(i in 1 .. 10) {
|
||||
if (i % 5 == 0) {
|
||||
println(i)
|
||||
continue
|
||||
}
|
||||
print("$i, ")
|
||||
}
|
||||
}
|
||||
7
Task/Loops-Continue/SPL/loops-continue.spl
Normal file
7
Task/Loops-Continue/SPL/loops-continue.spl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
> n, 1..10
|
||||
s += n
|
||||
? n%5, s += ", "
|
||||
>> n%5
|
||||
#.output(s)
|
||||
s = ""
|
||||
<
|
||||
13
Task/Loops-Continue/Simula/loops-continue.simula
Normal file
13
Task/Loops-Continue/Simula/loops-continue.simula
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
! Loops/Continue - simula67 - 07/03/2017;
|
||||
begin
|
||||
integer i;
|
||||
for i:=1 step 1 until 10 do begin
|
||||
outint(i,5);
|
||||
if mod(i,5)=0 then begin
|
||||
outimage;
|
||||
goto loop
|
||||
end;
|
||||
outtext(", ");
|
||||
loop:
|
||||
end
|
||||
end
|
||||
8
Task/Loops-Continue/Stata/loops-continue.stata
Normal file
8
Task/Loops-Continue/Stata/loops-continue.stata
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
forvalues n=1/10 {
|
||||
display `n' _continue
|
||||
if mod(`n',5)==0 {
|
||||
display
|
||||
continue
|
||||
}
|
||||
display ", " _continue
|
||||
}
|
||||
14
Task/Loops-Continue/Transact-SQL/loops-continue.sql
Normal file
14
Task/Loops-Continue/Transact-SQL/loops-continue.sql
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
DECLARE @i INT = 0;
|
||||
DECLARE @str VarChar(40) = '';
|
||||
WHILE @i<10
|
||||
BEGIN
|
||||
SET @i = @i + 1;
|
||||
SET @str = @str + CONVERT(varchar(2),@i);
|
||||
IF @i % 5 = 0
|
||||
BEGIN
|
||||
PRINT @str;
|
||||
SET @str =''
|
||||
CONTINUE;
|
||||
END
|
||||
SET @str = @str +', ';
|
||||
END;
|
||||
2
Task/Loops-Continue/Zkl/loops-continue.zkl
Normal file
2
Task/Loops-Continue/Zkl/loops-continue.zkl
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
foreach n in ([1..10]){print(n); if(n%5==0){println(); continue;} print(", ")}
|
||||
// or foreach n in ([1..10]){print(n,(n%5) and ", " or "\n")}
|
||||
Loading…
Add table
Add a link
Reference in a new issue