problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
acwing::acwing749类 参考

AcWing 749. 数组的上方区域 更多...

#include <acwing.h>

静态 Public 成员函数

static int main (istream &cin, ostream &cout)
 

详细描述

AcWing 749. 数组的上方区域

在文件 acwing.h1049 行定义.

成员函数说明

◆ main()

int acwing::acwing749::main ( istream &  cin,
ostream &  cout 
)
static

在文件 acwing.cpp3270 行定义.

3270 {
3271 char op;
3272 cin >> op;
3273 double sum = 0;
3274 int count = 0;
3275 double m[12][12];
3276 for(int i = 0; i < 12; i++) {
3277 for(int j = 0; j < 12; j++) {
3278 cin >> m[i][j];
3279 if(j > i && i + j < 11) {
3280 sum += m[i][j];
3281 count++;
3282 }
3283 }
3284 }
3285 if(op == 'M') {
3286 sum /= count;
3287 }
3288 cout << fixed << setprecision(1) << sum;
3289 return 0;
3290 }

该类的文档由以下文件生成: