Program
tapsirmaC;
var
a,b,n,x,p:integer;
input,output:text;
begin
p:=0;
assign(input,'c.in');
assign(output,'c.out');
reset(input);
rewrite(output);
read(input,a,b,n);
for x:= 1 to n do
begin
if a*x mod n = b
then
p:=p+1;
end;
write(output,p);
close(input);
close(output);
end.
Program n1;
var a: array[1..30] of integer;
n,i: integer;
function st(i: integer): integer;
begin
st:=1;
for i:=1 to i do st:=st*2
end;
begin
readln(n);
for i:=1 to n do a[i]:=st(i);
for i:=n downto 1 do write(a[i],' ');
end.
<em>VAR</em>
<em> s: String;</em>
<em>BEGIN</em>
<em> Read(s);</em>
<em> Write((Ord(s[1])-48)*(Ord(s[2]) + Ord(s[3]) - 96));</em>
<em>END.</em>
#include <iostream>
using namespace std;
int main()
{
int S=0;
for(int i=1; i<11; i++)
S=S+i*i;
cout<<"in cycle for: "<<S<<endl;
S=0;
int i=1;
while(i<11)
{
S=S+i*i;
i++;
}
cout<<"in cycle while: "<<S<<endl;
S=0;
i=1;
do
{
S=S+i*i;
i=i+1;
}
while (i<11);
cout<<"in cycle do...while: "<<S<<endl;
return 0;
}
Sub HOK()
Dim c As Long, NOK As Long
a = CInt(InputBox("Введите первое число"))
b = CInt(InputBox("Введите второе число"))
If a = b Then
NOK = a
Else
c = a * b
Do
If a > b Then a = a - b Else b = b - a
Loop Until a = b
NOK = c / a
End If
MsgBox "НОК=" + Str(NOK)
End Sub