kapitan19
?>

Дана матрица размера m х n. вывести ее элементы в следующем порядке: первая строка слева направо, вторая строка справа налево, третья строка слева направо, четвертая строка справа налево и т. д. в c++, code blocks

Информатика

Ответы

Malenyuk
For (int i = 0; i < m, i++)
{
for (int j = 0; j < n; j++)
{
if (i % 2 == 0)
{
cout << a[i,j] << " ";
}
else
{
cout << a[i, n - j - 1] << " ";
}
}
cout << endl;
}
infosmolenskay

1)  

var mas:array[1..7] of integer;

    i:integer;

begin

writeln('Введите 7 целых чисел:');

for i:=1 to 7 do

begin

readln(mas[i]);

if(mas[i] mod 2 <>0) then mas[i]:=mas[i]*10;

end;

writeln('Изменённый массив:',mas);

end.

2) var mas:array[1..9] of integer;

    i,b:integer;

begin

writeln('Введите 9 целых чисел:');

for i:=1 to 9 do

begin

readln(mas[i]);

if(mas[i] <0) then b:=b+mas[i];

end;

writeln('Сумма отрицательных элементов= :',b);

end.

3) var mas:array[1..4] of integer;

    i,b:integer;

   

 

begin

writeln('Введите 4 целые числа:');

b:=1;

for i:=1 to 4 do

begin

readln(mas[i]);

b:=b*mas[i];

 

end;

writeln('Произведение чисел= ',b);

end.

nikdenly

 if (N mod 2 <> 0) and (N mod 3 = 0) then

 if ((N >= 345) and (N < 543)) or (N mod 7 = 0) then

 if (N mod 3 = 0) or (N mod 10 = 0) then

 if (N >= 231) and (N < 312) and (N mod 3 <> 0) then

 if (N mod 2 <> 0) and (N div 10 mod 10 <= 5) then

 if (N > 9) and (N < 100) and (N mod 10 = N div 10) then

 if (N mod 10 = 4) and (N div 100 mod 10 > 3) then

 if (N > 9) and (N < 100) and (N div 10 mod 2 <> 0) then

 if (N mod 2 = 0) and (N div 10 mod 10 > 5) then

 if (N > 99) and (N < 1000) and (N div 100 = 8) then

 if (a mod 2 = 0) or (b mod 2 = 0) then

 if (a + b > 56) and (a + b < 145) then

 if (a mod 10 = 6) and (b mod 10 = 6)

 if (a > 0) and (b > 9) and (b < 100) then  

 if (a div 10 mod 10 < 5) or (b div 100 mod 10 > 3) then  

 if (a mod 3 = 0) or (b mod 5 <> 0) then

 if (a > 0) and (b >= 0) then

 if (a > 100) or (b > 100) then  

 if (a mod 8 > 4) and (b mod 12 < 5) then  

 if (a mod 2 <> 0) and (b mod 2 <> 0) then

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

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

Дана матрица размера m х n. вывести ее элементы в следующем порядке: первая строка слева направо, вторая строка справа налево, третья строка слева направо, четвертая строка справа налево и т. д. в c++, code blocks
Ваше имя (никнейм)*
Email*
Комментарий*

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

lovel24
urazmetova
dpodstrel85
nata27-73589
gnsnodir5001
Египтян2004
infoproletarskay745
PetrovnaTsukanov
oloinics
plv-57
jstepanova
druzhbamagazin2457
gorod7
nastya3213868
soa8690