Здесь Вы можете найти ответы на многие вопросы или задать свой вопрос!
#include < stdio.h> #include < stdlib.h> #include < conio.h> #include < math.h> int main(){ int x, y; printf("\n vvedite x and y: "); scanf("%d" "%d", & x, & y); if (x < y) printf("\n x = %d, y = %d", (x + y)/2, 2 * x * y); else printf("\n x = %d, y = %d", 2 * x * y, (x + y)/2); printf("\n\n to "); getch( ); return 0; }
компьютер телфон и иже с ними
var x1,x2,x3,s1,s2,s3: integer;
function sumofnumber(num: integer): integer;
var s: string;
i: integer;
begin
s: =str(num);
for i: = 1 to length(s) do
sumofnumber: = sumofnumber+int(s[i]);
end;
read(x1,x2,x3);
s1: =sumofnumber(x1);
s2: =sumofnumber(x2);
s3: =sumofnumber(x3);
if s1> s2 and s1> s3 then writeln(x1);
if s2> s1 and s2> s3 then writeln(x2);
if s3> s2 and s3> s1 then writeln(x3);
end.
в правильности написания функции типов не уверенна.
program qwe;
uses crt;
var c, s, i: integer; y: real;
begins: =0; c: =0; for i: = -2 to 27 dobegins: =s+i; c: =c+1; y: =s/c; end; writeln('srednee arifmeticheskoe=',y);
readln; end.
вот так вот должна быть 1 . ты ни где не илпользовал(а) счетчик, а это неправильно=) в этом твоя и была ошибка=)
Популярные вопросы