上传者: 43966957
|
上传时间: 2022-12-16 13:13:53
|
文件大小: 48KB
|
文件类型: DOC
实例1:绘制流程图,求三个数中最小数。 实例2:阅读下段程序,绘制其对应的流程图。 PROCEDURE average INTERFACE RETURNS average,sum,n1;*n1为有效成绩的个数。* INTERFACE ACCEPTS score; TYPE score[1,50] IS SCALAR ARRAY; TYPE average,n1,n2,sum IS SCALAR;*n2为输入值的个数。* TYPE i IS INTEGER; i = 1;n1=n2=0;sum=0; DO WHILE (score[ i ]<> – 1)AND(n2<50) n2 加 1; IF (score[ i ]>=0)AND(score[ i ]<=100) THEN n1 加 1; sum = sum + score[ i ]; END IF; i 加 1; END DO; IF n1> 0 THEN average = sum/n1; ELSE average = – 1; END IF; END average ----------------------- 输入A,B,C