猿问

一道很简单的求平均数的问题


5847fa080001ee6105000363.jpg

我的程序一直报错

我是新手 大神可以帮我看看嘛

晴书
浏览 1114回答 1
1回答

Yexiaomo

#include <stdio.h> int main(){ int n,i,a; float sum; while(scanf("%d", &n) != EOF && n > 0){ sum = 0; for(i = 1; i <= n; ++i){ scanf("%d", &a); sum+=a; } printf("%.2f\n", sum/n); } return 0; }看着能不能通过, 过不去了, 把错误提示贴上来-----头文件应导入: stdio.h数组没有必要定义

慕瓜9220888

LJBRQHFWGYWLUNQADDZIUJJQYOQOWTLRIQKBDTZIRYOEPLQILAHYLFFUVNWTKHIQPXIXULSJGEJMVURHIWVXWFYVLFPEWFSFCZIZOOATQWHHCGWZRVIVVCGQSRSCMGWEYSRYFMGLBRWZZJGQVNWJSZFCDWEDCLBQHYQUTCVMJTDFUGFHOFMGNVCOUUVBEHBXNMWAQXWOXGFMCZSBJIRKXGKQRZQJLSPZAFTCBCWNNXBTFONCJAHJXMXQZMCIVWFGMIORYMVNPXQKJMYCEPYOXNGSGVODKLISJOUPFGGNOTJSRQVYPGOMPEDREMBYWIXGDBYPDAJBAXYOZVNFOXEYSJZIQJIPMGKIHQKZWDNYCRGTBYFYYJRUJCSWQXYWFODAHRCYNFVEKBYIKYRKSHOYZSATSHEBAUYWWPMTZCFYMPOHOULCWKWPYFWMNBJIIAOUVFOCBATKAGKLGYPYMDJKKYRANRFMGMUNWFCGGALKJIKLRCCBJFHAHKUVHEONZFYUKULXCRAJMQNHFQZLIERIJOQOCLVLBIKMRUVVLVMRDQJMSPKSAYKALORHCFUDDAGWLCXCLOKKAMUMBXDGJJVWONYBLHNMJBTKHQZTQRHTHOEMFGWUCRKKHDWKWUMWLCLGRTBDMGUKYFUWOKNJZWLAHKBYOZJGYAJSILRQOPYWPPCMYZEGOIBPVYAGRXGZMMMTLDFPFYEUIUJUEKUNLZRSOOHWFLKSSROFCWKILUMZRVPMEJCMTQHYECWVOVPGWNUWZUFMMWCQPYXEROVUCEDJAABLYXFIBZ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