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

AcWing 750. 数组的下方区域 更多...

#include <acwing.h>

静态 Public 成员函数

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

详细描述

AcWing 750. 数组的下方区域

在文件 acwing.h1057 行定义.

成员函数说明

◆ main()

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

在文件 acwing.cpp3292 行定义.

3292 {
3293 char op;
3294 cin >> op;
3295 double sum = 0;
3296 int count = 0;
3297 double m[12][12];
3298 for(int i = 0; i < 12; i++) {
3299 for(int j = 0; j < 12; j++) {
3300 cin >> m[i][j];
3301 if(i + j > 11 && i > j) {
3302 sum += m[i][j];
3303 count++;
3304 }
3305 }
3306 }
3307 if(op == 'M') {
3308 sum /= count;
3309 }
3310 cout << fixed << setprecision(1) << sum;
3311 return 0;
3312 }

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