repl.it
@FelishaMiranda/

Compare the Triplets

C

No description

fork
loading
Files
  • main.c
main.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
#include <stdio.h>

int main() {
  
  int alice[5];
  int bob[5];
  int i, j, k, a=0, b=0, c, n;

  for (i=0; i<3; i++){
    scanf("%d", &alice[i] );
    getchar();
  }
  for (i=0; i<3; i++){
    scanf("%d", &bob[i] );
    getchar();
  }

  for (i=0; i<3; i++){
    if(alice[i]>bob[i]){
      a++;
    } else if(alice[i]<bob[i]){
      b++;
    }
  }

printf("%d %d\n", a, b);

}