Не знаю с++, но знаю с#, языки похожи, так что сможешь переписать с синтаксисом с++: int avg = 1; random rand = new random(); int a = console.readline(); int[] array = new int[a]; for (int i = 0; i < array.length; i++) { array[i] = rand.next(-80, 81); if (i % 2 ! = 0 & & array[i] % 7 = 0 & & array[i] > 0) { console.writeline(array[i]); } } console.readkey;
Спасибо
Ответ дал: Гость
program xxx;
var n, c, d, e, s : integer;
begin
write('введите число');
readln(n);
c: = n div 100;
d: =(n div 10) mod 10;
e: = n mod 10;
s: = c + d + e;
writeln('сумма чисел =', s);
readln
end.
Ответ дал: Гость
program mdd; uses crt; var a,b,c,d: longint; beginclrscr; readln(a,b,c,d); if (a> b) and (a> c) and (a> d) and (d< a) and (d< c) and (d< b) then writeln('правда')else writeln(''неправда); readkey; end.
Популярные вопросы