#include <iostream>
using namespace std;
int main ()
{
int N , M , step = 0;
while (cin>>N>>M)
{
if (N == 0 && M == 0) break;
int nn[3][N][M];
int result[N][M];
step++;
for (int num = 0; num < 3; num++)
{
for (int i = 0; i < N; i++)
{
for (int j = 0; j < M; j++)
{
cin>>nn[num][i][j];
}
}
}
for (int i = 0; i < N; i++)
{
for (int j = 0; j < M; j++)
{
result[i][j] = (nn[0][i][j] + nn[1][i][j] + nn[2][i][j]) / 3;
}
}
cout<<"Case "<<step<<":"<<endl;
for (int i = 0; i < N; i++)
{
for (int j = 0; j < M; j++)
{
cout<<result[i][j];
if (j != M - 1) cout<<",";
else cout<<endl;
}
}
}
return 0;
}
ZOJ Problem Set - 2857 Image Transformation
最新推荐文章于 2019-08-10 13:10:40 发布