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

AcWing 752. 数组的右方区域 更多...

#include <acwing.h>

静态 Public 成员函数

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

详细描述

AcWing 752. 数组的右方区域

在文件 acwing.h1069 行定义.

成员函数说明

◆ main()

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

在文件 acwing.cpp3336 行定义.

3336 {
3337 char op;
3338 cin >> op;
3339 double sum = 0;
3340 int count = 0;
3341 double m[12][12];
3342 for(int i = 0; i < 12; i++) {
3343 for(int j = 0; j < 12; j++) {
3344 cin >> m[i][j];
3345 if(i + j > 11 && i < j) {
3346 sum += m[i][j];
3347 count++;
3348 }
3349 }
3350 }
3351 if(op == 'M') {
3352 sum /= count;
3353 }
3354 cout << fixed << setprecision(1) << sum;
3355 return 0;
3356 }

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