[ create a new paste ] login | about

Link: http://codepad.org/COgXVknt    [ raw code | output | fork ]

C, pasted on Dec 5:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>

int main() {
  int i, j, x, y, keisu[2][3];

  printf("ax + by + c\n");
  printf("dx + ey + f\n");
  printf("(a, b, c, d, e, f) > ");
  for (i = 0; i < 2; ++i) {
    for (j = 0; j < 3; ++j) {
      scanf("%d", &keisu[i][j]);
    }
  }

  x = keisu[0][2] * keisu[1][1] - keisu[0][1] * keisu[1][2];
  y = -keisu[0][2] * keisu[1][0] + keisu[1][2] * keisu[0][0];
  
  printf("(x, y) = (%d, %d)\n", x, y);
  
  return 0;
}


Output:
1
2
3
ax + by + c
dx + ey + f
(a, b, c, d, e, f) > (x, y) = (2101103320, 1895766960)


Create a new paste based on this one


Comments: