===== PascalABC.NET =====
begin
for var x := 0 to 180 do
Writeln(x:3, Sin(DegToRad(x)):20:15)
end.
Например с помощью оператора if:
Неполное if {условие} then do {...}
Полное
if {условие} then do {...}
else do {в противном случае}
Без библиотек.
int main ()
{
int S = 0; int k, n;
cin >> n;
for (k = n; k != 0; k--)
{
if (k > 2)
S = S + k;
}
cout << S << endl;
system ("pause");
return 0;
}
<h2>Pascal</h2>
var n,k,m: integer;
begin
write('двоичное число: '); readln(n);
k:=1; m:=0;
repeat
m:=m+k*(n mod 10);
n:=n div 10;
k:=k*2;
until n=0;
writeln('десятичное число: ',m);
end.
#include <iostream>
<span>using namespace std;
</span>int main() {
<span> int a,b;
</span><span> float sr=0;
</span><span> cout<<"a = "; cin>>a;
</span><span> cout<<"b = "; cin>>b;
</span><span> for (int i=a; i<=b; i++) sr+=i;
</span><span> sr=sr/(b-a+1);
</span><span> cout<<sr<<endl;
</span><span> system("pause");
</span><span> return 0;
</span><span>}
</span><span>
</span>