-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2_Lab03_1.c
More file actions
40 lines (39 loc) · 796 Bytes
/
2_Lab03_1.c
File metadata and controls
40 lines (39 loc) · 796 Bytes
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
#include <stdio.h>
#include <string.h>
int main()
{
int n;
scanf("%d", &n);
int arr[201][4] = { 0, };
int result[201] = { 0, };
for (int i = 0; i < n; i++)
{
for (int j = 0; j < 3; j++)
{
scanf("%d", &arr[i][j]);
}
}
for (int j = 0; j < 3; j++)
{
for (int i = 0; i < n; i++)
{
int cnt = 0;
for (int k = 0; k < n; k++)
{
if (arr[i][j] == arr[k][j] && i != k)
{
cnt = 1;
break;
}
}
if (cnt == 0)
{
result[i] += arr[i][j];
}
}
}
for (int i = 0; i < n; i++)
{
printf("%d\n", result[i]);
}
}