Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
143995 徐景一 财务管理 C++ Compile Error 0 MS 0 KB 248 2026-01-18 09:58:04

Tests(0/0):


Code:

#include <iostream> using namespace std; int main(){ double a[12],zong; int i; for(i=0;i<12;i++){ scanf("%lf",a[i]); } for(i=0;i<12;i++){ zong+=a[i]; } printf("%.2lf",zong/12); return 0;


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:25: warning: format '%lf' expects argument of type 'double*', but argument 2 has type 'double' [-Wformat=]
         scanf("%lf",a[i]);
                         ^
Main.cc:13:9: error: expected '}' at end of input
 return 0; 
         ^
Main.cc:7:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lf",a[i]);
                          ^