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

AcWing 748. 数组的右下半部分 更多...

#include <acwing.h>

静态 Public 成员函数

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

详细描述

AcWing 748. 数组的右下半部分

在文件 acwing.h990 行定义.

成员函数说明

◆ main()

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

在文件 acwing.cpp2983 行定义.

2983 {
2984 char op;
2985 cin >> op;
2986 double sum = 0;
2987 int count = 0;
2988 double m[12][12];
2989 for(int i = 0; i < 12; i++) {
2990 for(int j = 0; j < 12; j++) {
2991 cin >> m[i][j];
2992 if(i + j >= 12) {
2993 sum += m[i][j];
2994 count++;
2995 }
2996 }
2997 }
2998 if(op == 'M') {
2999 sum /= count;
3000 }
3001 cout << fixed << setprecision(1) << sum;
3002 return 0;
3003 }

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