///@author Sycamore, ZJNU ///@accepted_on 2017-01-19 #include<iostream> using namespace std; short p[3][100][100]; int main() { short N, M; int c = 0; while (cin >> N >> M&&N&&M) { for (int k = 0; k < 3; k++) for (int i = 0; i<N; i++) for (int j = 0; j < M; j++) { cin >> p[k][i][j]; } cout << "Case " << ++c << ‘:‘ << endl; for (int i = 0; i<N; i++) for (int j = 0; j < M; j++) { cout << (p[0][i][j] + p[1][i][j] + p[2][i][j]) / 3; if (j == M - 1) cout << endl; else cout << ‘,‘; } } return 0; }
ZOJ 2857: Image Transformation
原文:http://www.cnblogs.com/zjnu/p/7248035.html