1)
#include <iostream>
using namespace std;
void draw_square(int n)
{
for(int y = 0; y < n; y++)
{
for (int x = 0; x < n; x++)
cout << "*";
cout << endl;
}
}
int main()
{
int n;
cin >> n;
draw_square(n);
return 0;
}
2)
#include <iostream>
using namespace std;
void drawNumbers(int a)
{
while(a > 0)
{
cout << a%10 << endl;
a /= 10;
}
}
int main()
{
int a;
cin >> a;
drawNumbers(a);
return 0;
}
3)
#include <iostream>
using namespace std;
int main()
{
//можно гораздо быстрей, но мне лень
int a;
cin >> a;
for(int i = 1; i <= a; i++) if(a%i==0) cout << i << " ";
return 0;
}
4)
#include <iostream>
using namespace std;
void procedure(int a)
{
int b = a;
int c = 1;
while(b > 0) {c *= 10; b/=10;}
while(c > 1)
{
cout << (a%c)/(c/10) << endl;
c /= 10;
}
}
int main()
{
int a;
cin >> a;
procedure(a);
return 0;
}<span>
</span>
<span>Водитель в данном случае - управляющая система, а автомобиль - система управления, приборы автомобиля - каналы информационной связи, именно информационная связь используется в этом примере. Прямая линия: команды, исполняющие водитель или автомобиль. Обратная: состояние окр. среды и автомобиля. </span>
const
p = 3.14;
var
L, S:real;
begin
write('L = '); readln(L);
writeln('S = ', sqr (L / (2 * p)) * pi);
end.
Uses Drawman;
procedure Berry;
begin
field(14, 13);
topoint(2, 1);
pendown;
topoint(1, 2);
topoint(1, 3);
topoint(2, 4);
topoint(3, 4);
topoint(4, 3);
topoint(4, 2);
topoint(3, 1);
topoint(2, 1);
penup;
topoint(6, 1);
pendown;
topoint(5, 2);
topoint(5, 3);
topoint(6, 4);
topoint(7, 4);
topoint(8, 3);
topoint(8, 2);
topoint(7, 1);
topoint(6, 1);
penup;
end;
procedure Leaf;
begin
topoint(3,4);
pendown;
topoint(6,10);
topoint(4,12);
topoint(2,12);
topoint(4,10);
topoint(8,10);
topoint(10,8);
topoint(8,8);
topoint(6,10);
topoint(6,4);
end;
begin
Berry;
Leaf;
end.