Mydariamiro
?>

Выполнить полностью в excel. прикрепил к вопросу.

Информатика

Ответы

Yekaterina Oksyuta1657
#include < iostream> #include < iomanip> #include < cstdlib> #include < ctime> template < typename t> void swap(t & a, t& b) { t t=a; a=b; b=t; } void printarray(int *array, int length) { for (int i=0; i< length; i++) std: : cout< < std: : setw(4)< < array[i]; std: : cout< < std: : endl; } int main() { srand(time(0)); int length; std: : cin> > length; int *array=new int[length]; for (int i=0; i< length; i++) array[i]=rand()%100+1; printarray(array,length); int posmax=0; for (int i=1; i< length; i++) if (array[posmax]< array[i]) posmax=i; bool flag=false; while (flag==false) { flag=true; for (int i=posmax+2; i< length; i++) if (array[i]< array[i-1]) { flag=false; swap(array[i],array[i-1]); } } printarray(array,length); return 0; }
marim1994361

uses drawman;

begin

field(10,10);

    penup;

    topoint(4,4);

    pendown;

    topoint(6,4);

    topoint(6,6);

    topoint(4,6);

    topoint(4,4);

    topoint(5,1);

    topoint(6,4);

    topoint(9,5);

    topoint(6,6);

    topoint(5,9);

    topoint(4,6);

    topoint(1,5);

    topoint(4,4);

end.

Ответить на вопрос

Поделитесь своими знаниями, ответьте на вопрос:

Выполнить полностью в excel. прикрепил к вопросу.
Ваше имя (никнейм)*
Email*
Комментарий*

Популярные вопросы в разделе

Serafim
Tselyaritskaya Yurevich
artbogema2016
Aleks0091
AnastasiyaSkripin1283
info6
eugene869154
kyrtlab39
lovel24
printlublino
AlidzhanovDenis491
silicon-films3375
ev27076878
ekasatkina
Измайлова-Алексей
▲