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

AcWing 751. 数组的左方区域 更多...

#include <acwing.h>

静态 Public 成员函数

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

详细描述

AcWing 751. 数组的左方区域

在文件 acwing.h1063 行定义.

成员函数说明

◆ main()

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

在文件 acwing.cpp3314 行定义.

3314 {
3315 char op;
3316 cin >> op;
3317 double sum = 0;
3318 int count = 0;
3319 double m[12][12];
3320 for(int i = 0; i < 12; i++) {
3321 for(int j = 0; j < 12; j++) {
3322 cin >> m[i][j];
3323 if(i + j < 11 && i > j) {
3324 sum += m[i][j];
3325 count++;
3326 }
3327 }
3328 }
3329 if(op == 'M') {
3330 sum /= count;
3331 }
3332 cout << fixed << setprecision(1) << sum;
3333 return 0;
3334 }

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