-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest6.c
78 lines (60 loc) · 992 Bytes
/
test6.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include <stdio.h>
/*
int main()
{
int a[10] = {};
int i;
for(i = 0; i < 10; ++i)
printf("%d\n", a[i]);
return 0;
}
int main()
{
int a = 1, b = 2, c = 3;
int x;
x = a^b;
printf("%d\n", x);
return 0;
}*/
/*
int main()
{
int n = 6;
switch(n--)
{
default:printf("%d", n++);
case 3:printf("%d", n--);break;
case 2:printf("%d", n++);
case 1:printf("%d", n--);
}
}
int main()
{
int *a, *b, *c;
a - b;
return 0;
}
int main()
{
int num = 15;
printf("%s\n", (num%2)?"yy":"lod");
return 0;
}*/
#define N 4
int main()
{
int a[N][N], i, j, sum1 = 0, sum2 = 0;
for(i = 0; i < N; i++)
for(j = 0; j < N; j++)
{
printf("%d = , %d = \n", i, j);
scanf("%d", *(a + i) + j);
}
for(j = 0; j < N; j++)
{
sum1 += a[j][j];
sum2 += a[j][3 - j];
}
printf("%d, %d\n", sum1, sum2);
return 0;
}