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

AcWing 747. 数组的左上半部分 更多...

#include <acwing.h>

静态 Public 成员函数

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

详细描述

AcWing 747. 数组的左上半部分

在文件 acwing.h996 行定义.

成员函数说明

◆ main()

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

在文件 acwing.cpp3068 行定义.

3068 {
3069 char op;
3070 cin >> op;
3071 double sum = 0;
3072 int count = 0;
3073 double m[12][12];
3074 for(int i = 0; i < 12; i++) {
3075 for(int j = 0; j < 12; j++) {
3076 cin >> m[i][j];
3077 if(i + j < 11) {
3078 sum += m[i][j];
3079 count++;
3080 }
3081 }
3082 }
3083 if(op == 'M') {
3084 sum /= count;
3085 }
3086 cout << fixed << setprecision(1) << sum;
3087 return 0;
3088 }

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