Здесь Вы можете найти ответы на многие вопросы или задать свой вопрос!
на паскале:
program myprogram; var n,i,fact: integer; sum: real; beginsum: =0; fact: =1; writeln('введите число n.'); readln(n); for i: =1 to n dobeginfact: =fact*i; sum: =sum+1/fact; end; writeln('сумма 1/1! +1/2! +1/3! ++1/n = ',sum); end.
vara,b: integer; c: real; beginwriteln ('1'); read (a); writeln ('2'); read (b); c: =(a/1)/(1/b); writeln (c); end.
я бы сделал
program p_1; var a,b: real; beginwriteln ('vvedite 1-oe'); read (a); writeln ('vvedite 2-oe'); read (b); if (a> b) thenbegin writeln ( ' 1-oe bolshe (',a,')' ); end; if (a< b) thenbegin writeln ( ' 1-oe menshee. bolshe vtoroe (',b,')' ); end; if a=b thenbegin writeln ('oni ravni'); end; end.
Популярные вопросы