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

AcWing 745. 数组的右上半部分 更多...

#include <acwing.h>

静态 Public 成员函数

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

详细描述

AcWing 745. 数组的右上半部分

在文件 acwing.h984 行定义.

成员函数说明

◆ main()

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

在文件 acwing.cpp2961 行定义.

2961 {
2962 char op;
2963 cin >> op;
2964 double sum = 0;
2965 int count = 0;
2966 double m[12][12];
2967 for(int i = 0; i < 12; i++) {
2968 for(int j = 0; j < 12; j++) {
2969 cin >> m[i][j];
2970 if(j > i) {
2971 sum += m[i][j];
2972 count++;
2973 }
2974 }
2975 }
2976 if(op == 'M') {
2977 sum /= count;
2978 }
2979 cout << fixed << setprecision(1) << sum;
2980 return 0;
2981 }

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