next up previous contents
Next: Problem 1 Up: データの入力と条件 Previous: Sample Program 3b   Contents

Sample Program 3c

同じ最大値を求める作業を今度は、データをユーザーが入力して行います。
\begin{code}
100 input ''a'';a
110 input ''b'';b
120 input ''c'';c
130 max1=-100...
...b>max1 then max1=b
160 if c>max1 then max1=c
170 print max1
990 end
\end{code}
この例では、a,b,cの3つの実数のうち最大のものが、最終的にmax1に残ることになります。



Takeyoshi Nagai 2013-10-07