| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 79416 | 蒙恒羽 | 计算平均数 | C++ | Compile Error | 0 MS | 0 KB | 290 | 2024-07-05 20:17:33 |
#include<iostream> #include<vector> using namespace std; int main(){ vector<int> a; for(int j=0;j<5;j++){ int i; cin>>i; a.push_back(i); } int abc; for(int row:a){ abc += row; } printf("%.2f", abc / a.length()) }
Main.cc: In function 'int main()':
Main.cc:16:28: error: 'class std::vector' has no member named 'length'
printf("%.2f", abc / a.length())
^