程式題輸入數找出並顯示其中的最大數

2021-12-23 01:07:44 字數 1489 閱讀 7627

1樓:匿名使用者

var x,y,z,max:integer;

begin

readln(x,y,z);

max:=x;

if y>max then max:=y;

if z>max then max:=z;

writeln(max);

end.

2樓:太陽精靈

其實非常的簡單,不必要很煩。

var i,a,b:integer;

begin

for i:=1 to 3 do 迴圈begin

readln(a); 讀入if a>b then b:=a; 比較一下,如果a大於b,就把b內放a。(打擂台,b存下最大)

end;

writeln(b); 輸出end.

3樓:超越的侷限

新增乙個按鈕

var x,y,z,max:integer;

begin

x := strtoint(edt1.text);

y := strtoint(edt2.text);

z:= strtoint(edt3.text);

if x>y then

max := x

else

max:= y;

if result < z then

max := z;

edt4.text := inttostr(max);

end;

4樓:匿名使用者

function max(x, y, z: integer): integer;

begin

if x>y then

result := x

else

result := y;

if result < z then result := z;

end;

5樓:匿名使用者

vara,b,c:longint;

begin

readln(a,b,c);//讀入3個數if a>b then b:=a;

if b>c then c:=b;

writeln(c);

end.

6樓:匿名使用者

我用math單元的

program exmple(input,output);

uses

math;

varx,y,z,ma:integer;

begin

writeln('input three numbers.');

readln(x,y,z);

ma:=max(x,y);

ma:=max(ma,z);

writeln(ma);

readln;

readln

end.

依次將數輸入,要求將其中最大的數列印出來

include main printf d max include void input int arr,int len void output int arr,int len void main int a 10 input a,10 int i for i 0 i 9 i if a i 久不 抄...

程式設計序,輸入實數x的值,按下列公式計算並輸出y值

include double fun double x for test int main c語言程式設計 輸入x的值,按下面公式計算並輸出y的值 輸出資料佔8列,精確到0.001 include include int main void return 0 include include int ...

先觀察下面一組算式的前3題,找出其中的規律,並根據規律直接寫

1 因為142857 4時,個位上的數是8,所以1428 4 571428,2 因為142857 5時,個位上的數是5,所以142857 5 714285 3 因為142857 6時,個位上的數是2,所以142857 6 857142,故答案為 571428,714285 857142 先觀察下面一...