Написать фрагмент программы, подсчитывающий сумму только положительных из трех данных чисел.
Ответ
Автор - alexooooon
var a,b,c:real; begin readln(a,b,c); if (b>0) and (a > 0) and (c > 0) then write((c+a+b):0:0); if (b>0) and (a>0) and (c<0) then write((a+b):0:0); if (b>0) and (a<0) and (c>0) then write((b+c):0:0); if (b<0) and (a>0) and (c>0) then write((a+c):0:0) end.
Ответ
Автор - Igorrock
If (a>0) or (a=0) Then s:=s+a; If (b>0) or (b=0) Then s:=s+b; If (c>0) or (c=0) Then s:=s+c;