С++ В устройствах для перфорации проездных в общественном транспорте используется 9 точек перфорации, расположенных в форме матрицы 3x3. Сгенерируйте все , которыми можно пробивать билеты.

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
лолкекчибурек1
04.05.2021 20:01

uses drawman;

Procedure w;

Begin

PenDown;

OnVector (0,-7);

OnVector (2,0);

OnVector (0,7);

PenUp;

OnVector (0,-7) ;

PenDown;

OnVector (2,0);

OnVector (0,7);

PenUp;

end;

procedure T;

Begin

PenDown;

OnVector (0,7);

OnVector (-2,0);

OnVector(4,0); penUp;

end;

procedure O;

Begin

PenDown;

OnVector (4,0);

OnVector (0,7);

OnVector (-4,0);

OnVector (0,-7);

PenUp;

end;

procedure R;

PenDown;

OnVector (0,7);

OnVector (4,0);

OnVector (0,-4);

OnVector (-4,0);

PenUp;

end;

procedure A;

begin

PenDown;

OnVector (2,7);

OnVector (2,-7);

PenUp;

OnVector (-3,3);

PenDown;

OnVector (2,0);

PenUp;

end;

begin

Field (32,10);

ToPoint (3,7); w;

OnVector (4,-7); T;

OnVector (2,-7); O;

OnVector (6,0); R;

OnVector (5,-3); A;

end.

Вроде работает

0,0(0 оценок)
Ответ:
Ембергенова
01.06.2020 16:59

Скопировать код в Dev C++ и запустить в компиляторном окне будут выведены значения.

Объяснение:

Dev C++

1) #include <iostream>

#include <stdio.h>

#include <stdlib.h>

#include <math.h>

int main(int argc, char** argv) {

int x = 5, y = 10;

while(y<=10){

 if (x <= y){

  x = x + 1;

  y = y - 1;

 }

 else {

  x = x - 5;

  y = y + 5;

 }  

}

printf("X = %d", x);

printf("\nY = %d", y);

return 0;

}

2) #include <iostream>

#include <stdio.h>

#include <stdlib.h>

#include <math.h>

int main(int argc, char** argv) {

int a = 2, b = 0;

while (a != 7){

 a = a + 1;

 b = b + a;

}

printf("a = %d", a);

printf("\nb = %d", b);

return 0;

}

3) #include <iostream>

#include <stdio.h>

#include <stdlib.h>

#include <math.h>

int main(int argc, char** argv) {

int a = 56, b = 77;

while (a != b){

 if (a > b){

  a = a - b;

 }

 else {

  b = b - a;

 }

}

printf("a = %d", a);

printf("\nb = %d", b);

return 0;

}

4) #include <iostream>

#include <stdio.h>

#include <stdlib.h>

#include <math.h>

int main(int argc, char** argv) {

int a = 6, b = 0;

while (a!=2){

 b = b + a;

 a = a - 1;

}

printf("a = %d", a);

printf("\nb = %d", b);

return 0;

}

5) #include <iostream>

#include <stdio.h>

#include <stdlib.h>

#include <math.h>

int main(int argc, char** argv) {

int a = 1, b = 0;

while (a != 1024){

 b = b + a;

 a = a * 2;

}

printf("a = %d", a);

printf("\nb = %d", b);

return 0;

}

0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота