阅读下列FORTAN程序: INTEGER X(7) DATA X/4,5,

昕玥2019-12-17  16

问题 阅读下列FORTAN程序:INTEGER X(7)DATA X/4,5,7,8,10,12,11/DO 10 K=l,7IF(MOD(X(K),2)NE. 0)THEN S=S+X(K)N=N+1 END IF 10 CONTINUE T=S/NWRITE(*,20)S,T 20 FORMAT(2X,3F6.1)END程序运行后的输出结果是:

选项 A. 23.0 7.7B. 47. 0 6.7C. 34. 0 8.5D. 57. 0 11.4

答案A

解析此题为将读入的奇数相加,并除以奇数的个数。答案:A
转载请注明原文地址:https://ti.zuoweng.com/ti/lWUNKKKQ