简单的三位数组
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1857
1 #include <stdio.h>
2
3 int main()
{
4
5 int n,m,sum,ave;
6
7 int a[3][105][105];
8
9 int z=0;
10
11 while (scanf("%d%d",&n,&m)!=EOF && n && m)
{
12
13 for (int i=0; i<3; i++)
{
14
15 for (int j=0; j<n; j++)
{
16
17 for (int k=0; k<m; k++)
{
18
19 scanf("%d",&a[i][j][k]);
20
21 }
22
23 }
24
25 }
26
27 printf("Case %d:\n",++z);
28
29 for (int i=0; i<n; i++)
{
30
31 for (int j=0; j<m; j++)
{
32
33 sum=0;
34
35 for (int k=0; k<3; k++)
{
36
37 sum+=a[k][i][j];
38
39 }
40
41 ave = sum/3;
42
43 printf("%d",ave);
44
45 if (j!=m-1)
{
46
47 printf(",");
48
49 }
50
51 }
52
53 printf("\n");
54
55 }
56
57 }
58
59 return 0;
60
61 }