Var n,f,i:integer;
begin
n:=10;
f:=1;
for i:=1 to n do f:=f*i;
writeln(n,'! = ',f);
end.
Результат:
10! = 3628800
#include <iostream>
<span>#include <fstream>
</span><span>#include <cstring>
</span><span>using namespace std;
</span>int main() <span>{
</span><span> ifstream fi;
</span><span> ofstream fo;
</span><span> fi.open("input.txt");
</span><span> string sd,sw,inp = "";
</span><span> int i,j;
</span><span> while(!fi.eof())
</span><span> {
</span><span> fi>>i>>j;
</span><span> if (((i%2==0) && (j%2==0)) || ((i%2==1) && (j%2==1)))
</span><span> sd=sd+char(i+48)+" "+char(j+48)+" ";
</span><span> else sw=sw+char(i+48)+" "+char(j+48)+" ";
</span><span> }
</span><span> fi.close();
</span><span> fo.open("output.txt");
</span><span> fo<<sw<<endl;
</span><span> fo<<sd<<endl;
</span><span> fo.close();
</span><span> return 0;
</span><span>}
</span><span>
</span>
Крайне часто на глаза стала попадаться именно эта загадка.
Колонка <em>(а собака - болонка)</em>
Begin
for i:=1 to 30 do
a[i]:=random(50)-20;
for i:=1 to 30 do
if a[i]<0 then sum:=sum+a[i];
writeln(sum);
readln(k);
for i:=1 to 30 do
if (a[i]>0) and (a[i]<=k) then kol:=kol+1;
writeln(kol);
end.