码迷,mamicode.com
首页 > 其他好文 > 详细

ZOJ 2857: Image Transformation

时间:2017-07-28 01:01:55      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:ace   end   mat   names   image   ++   accept   nbsp   pre   

 

ZOJ - 2857

///@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

标签:ace   end   mat   names   image   ++   accept   nbsp   pre   

原文地址:http://www.cnblogs.com/zjnu/p/7248035.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!