#include <stdio.h> #include <stdbool.h> int main() { printf("TEAM : 장용운 새싹 1 이길상 새싹 2 김남효\n"); return 0; }
#include <stdio.h> #include <stdbool.h> #pragma warning (disable:4996) int main() { int a[8]; printf("TEAM : 장용운 새싹 1 이길상 새싹 2 김남효\n"); while (1) { for (int i = 0; i < 8; i++) { scanf("%d", &a[i]); } for (int i = 0; i < 8; i++) { if (a[0] == 1 && a[1] == 1 && a[2] == 1 && a[3] == 1) { return 0; } else { printf("%d ", a[i]); } } printf("\n"); } }
#include <stdio.h> #include <stdbool.h> #pragma warning (disable:4996) int reg00, reg01, reg10, reg11, mem00, mem01, mem10, mem11; void load(int a, int b, int c, int d) { int num; if (a == 0 && b == 0)num = mem00; if (a == 0 && b == 1)num = mem01; if (a == 1 && b == 0)num = mem10; if (a == 1 && b == 1)num = mem11; if (c == 0 && d == 0)reg00 = num; if (c == 0 && d == 1)reg01 = num; if (c == 1 && d == 0)reg10 = num; if (c == 1 && d == 1)reg11 = num; } int main() { int a[8],b[8]; printf("TEAM : 장용운 새싹 1 이길상 새싹 2 김남효\n"); for (int i = 0; i < 8; i++) { scanf("%d", &b[i]); } mem00 = b[4]; mem01 = b[5]; mem10 = b[6]; mem11 = b[7]; reg00 = b[0]; reg01 = b[1]; reg10 = b[2]; reg11 = b[3]; while (1) { for (int i = 0; i < 8; i++) { scanf("%d", &a[i]); } if (a[0] == 1 && a[1] == 1 && a[2] == 1 && a[3] == 1) { printf("%d %d %d %d %d %d %d %d", reg00, reg01, reg10, reg11, mem00, mem01, mem10, mem11); return 0; } else { load(a[4], a[5], a[6], a[7]); } } }
#include <stdio.h> #include <stdbool.h> #pragma warning (disable:4996) int reg00, reg01, reg10, reg11, mem00, mem01, mem10, mem11; void load(int a, int b, int c, int d) { int num; if (a == 0 && b == 0)num = mem00; if (a == 0 && b == 1)num = mem01; if (a == 1 && b == 0)num = mem10; if (a == 1 && b == 1)num = mem11; if (c == 0 && d == 0)reg00 = num; if (c == 0 && d == 1)reg01 = num; if (c == 1 && d == 0)reg10 = num; if (c == 1 && d == 1)reg11 = num; } void add(int a, int b, int c, int d) { int num; if (a == 0 && b == 0)num = reg00; if (a == 0 && b == 1)num = reg01; if (a == 1 && b == 0)num = reg10; if (a == 1 && b == 1)num = reg11; if (c == 0 && d == 0)reg00 += num; if (c == 0 && d == 1)reg01 += num; if (c == 1 && d == 0)reg10 += num; if (c == 1 && d == 1)reg11 += num; } void mul(int a, int b, int c, int d) { int num; if (a == 0 && b == 0)num = reg00; if (a == 0 && b == 1)num = reg01; if (a == 1 && b == 0)num = reg10; if (a == 1 && b == 1)num = reg11; if (c == 0 && d == 0)reg00 *= num; if (c == 0 && d == 1)reg01 *= num; if (c == 1 && d == 0)reg10 *= num; if (c == 1 && d == 1)reg11 *= num; } void save(int a, int b, int c, int d) { int num; if (a == 0 && b == 0)num = reg00; if (a == 0 && b == 1)num = reg01; if (a == 1 && b == 0)num = reg10; if (a == 1 && b == 1)num = reg11; if (c == 0 && d == 0)mem00 = num; if (c == 0 && d == 1)mem01 = num; if (c == 1 && d == 0)mem10 = num; if (c == 1 && d == 1)mem11 = num; } int main() { int a[8],b[8],c[2][2]; int num; printf("TEAM : 장용운 새싹 1 이길상 새싹 2 김남효\n"); for (int i = 0; i < 8; i++) { scanf("%d", &b[i]); } mem00 = b[4]; mem01 = b[5]; mem10 = b[6]; mem11 = b[7]; reg00 = b[0]; reg01 = b[1]; reg10 = b[2]; reg11 = b[3]; while (1) { for (int i = 0; i < 8; i++) { scanf("%d", &a[i]); } if (a[0] == 1 && a[1] == 1 && a[2] == 1 && a[3] == 1) { printf("%d %d %d %d %d %d %d %d", reg00, reg01, reg10, reg11, mem00, mem01, mem10, mem11); return 0; } else if (a[0] == 0 && a[1] == 0 && a[2] == 1 && a[3] == 0) { add(a[4], a[5], a[6], a[7]); } else if (a[0] == 0 && a[1] == 0 && a[2] == 1 && a[3] == 1) { mul(a[4], a[5], a[6], a[7]); } else if (a[0] == 0 && a[1] == 0 && a[2] == 0 && a[3] == 1) { save(a[4], a[5], a[6], a[7]); } else { load(a[4], a[5], a[6], a[7]); } } }
#include <stdio.h> #include <stdbool.h> #pragma warning (disable:4996) int reg00, reg01, reg10, reg11, mem00, mem01, mem10, mem11,equ = 0; void load(int a, int b, int c, int d) { int num; if (a == 0 && b == 0)num = mem00; if (a == 0 && b == 1)num = mem01; if (a == 1 && b == 0)num = mem10; if (a == 1 && b == 1)num = mem11; if (c == 0 && d == 0)reg00 = num; if (c == 0 && d == 1)reg01 = num; if (c == 1 && d == 0)reg10 = num; if (c == 1 && d == 1)reg11 = num; } void add(int a, int b, int c, int d) { int num; if (a == 0 && b == 0)num = reg00; if (a == 0 && b == 1)num = reg01; if (a == 1 && b == 0)num = reg10; if (a == 1 && b == 1)num = reg11; if (c == 0 && d == 0)reg00 += num; if (c == 0 && d == 1)reg01 += num; if (c == 1 && d == 0)reg10 += num; if (c == 1 && d == 1)reg11 += num; } void mul(int a, int b, int c, int d) { int num; if (a == 0 && b == 0)num = reg00; if (a == 0 && b == 1)num = reg01; if (a == 1 && b == 0)num = reg10; if (a == 1 && b == 1)num = reg11; if (c == 0 && d == 0)reg00 *= num; if (c == 0 && d == 1)reg01 *= num; if (c == 1 && d == 0)reg10 *= num; if (c == 1 && d == 1)reg11 *= num; } void save(int a, int b, int c, int d) { int num; if (a == 0 && b == 0)num = reg00; if (a == 0 && b == 1)num = reg01; if (a == 1 && b == 0)num = reg10; if (a == 1 && b == 1)num = reg11; if (c == 0 && d == 0)mem00 = num; if (c == 0 && d == 1)mem01 = num; if (c == 1 && d == 0)mem10 = num; if (c == 1 && d == 1)mem11 = num; } void equal(int a, int b, int c, int d) { int num,k; if (a == 0 && b == 0)num = reg00; if (a == 0 && b == 1)num = reg01; if (a == 1 && b == 0)num = reg10; if (a == 1 && b == 1)num = reg11; if (c == 0 && d == 0)k = reg00 ; if (c == 0 && d == 1)k = reg01; if (c == 1 && d == 0)k = reg10; if (c == 1 && d == 1)k = reg11; if (num == k) { equ = 1; } else equ = 0; } int main() { int a[8],b[8],c[2][2]; int num; printf("TEAM : 장용운 새싹 1 이길상 새싹 2 김남효\n"); for (int i = 0; i < 8; i++) { scanf("%d", &b[i]); } mem00 = b[4]; mem01 = b[5]; mem10 = b[6]; mem11 = b[7]; reg00 = b[0]; reg01 = b[1]; reg10 = b[2]; reg11 = b[3]; while (1) { for (int i = 0; i < 8; i++) { scanf("%d", &a[i]); } if (a[0] == 1 && a[1] == 1 && a[2] == 1 && a[3] == 1) { printf("%d %d %d %d %d %d %d %d", reg00, reg01, reg10, reg11, mem00, mem01, mem10, mem11); return 0; } else if (a[0] == 0 && a[1] == 0 && a[2] == 1 && a[3] == 0) { add(a[4], a[5], a[6], a[7]); } else if (a[0] == 0 && a[1] == 0 && a[2] == 1 && a[3] == 1) { mul(a[4], a[5], a[6], a[7]); } else if (a[0] == 0 && a[1] == 0 && a[2] == 0 && a[3] == 1) { save(a[4], a[5], a[6], a[7]); } else if (a[0] == 0 && a[1] == 1 && a[2] == 0 && a[3] == 0) { equal(a[4], a[5], a[6], a[7]); printf("%d\n", equ); } else { load(a[4], a[5], a[6], a[7]); } } }
#include <stdio.h> #include <stdbool.h> #pragma warning (disable:4996) int reg00, reg01, reg10, reg11, mem00, mem01, mem10, mem11, equ = 0, con=0; void load(int a, int b, int c, int d) { int num; if (a == 0 && b == 0)num = mem00; if (a == 0 && b == 1)num = mem01; if (a == 1 && b == 0)num = mem10; if (a == 1 && b == 1)num = mem11; if (c == 0 && d == 0)reg00 = num; if (c == 0 && d == 1)reg01 = num; if (c == 1 && d == 0)reg10 = num; if (c == 1 && d == 1)reg11 = num; } void add(int a, int b, int c, int d) { int num; if (a == 0 && b == 0)num = reg00; if (a == 0 && b == 1)num = reg01; if (a == 1 && b == 0)num = reg10; if (a == 1 && b == 1)num = reg11; if (c == 0 && d == 0)reg00 += num; if (c == 0 && d == 1)reg01 += num; if (c == 1 && d == 0)reg10 += num; if (c == 1 && d == 1)reg11 += num; } void mul(int a, int b, int c, int d) { int num; if (a == 0 && b == 0)num = reg00; if (a == 0 && b == 1)num = reg01; if (a == 1 && b == 0)num = reg10; if (a == 1 && b == 1)num = reg11; if (c == 0 && d == 0)reg00 *= num; if (c == 0 && d == 1)reg01 *= num; if (c == 1 && d == 0)reg10 *= num; if (c == 1 && d == 1)reg11 *= num; } void save(int a, int b, int c, int d) { int num; if (a == 0 && b == 0)num = reg00; if (a == 0 && b == 1)num = reg01; if (a == 1 && b == 0)num = reg10; if (a == 1 && b == 1)num = reg11; if (c == 0 && d == 0)mem00 = num; if (c == 0 && d == 1)mem01 = num; if (c == 1 && d == 0)mem10 = num; if (c == 1 && d == 1)mem11 = num; } void equal(int a, int b, int c, int d) { int num,k; if (a == 0 && b == 0)num = reg00; if (a == 0 && b == 1)num = reg01; if (a == 1 && b == 0)num = reg10; if (a == 1 && b == 1)num = reg11; if (c == 0 && d == 0)k = reg00 ; if (c == 0 && d == 1)k = reg01; if (c == 1 && d == 0)k = reg10; if (c == 1 && d == 1)k = reg11; if (num == k) { equ = 1; } else equ = 0; } void beq(int a, int b, int c, int d) { if (equ == 1) { con = a * 8 + b * 4 + c * 2 + d * 1; } } int main() { int a[8],b[8],c[2][2]; int num; printf("TEAM : 장용운 새싹 1 이길상 새싹 2 김남효\n"); for (int i = 0; i < 8; i++) { scanf("%d", &b[i]); } mem00 = b[4]; mem01 = b[5]; mem10 = b[6]; mem11 = b[7]; reg00 = b[0]; reg01 = b[1]; reg10 = b[2]; reg11 = b[3]; while (1) { for (int i = 0; i < 8; i++) { scanf("%d", &a[i]); } if (con >= 1) { con--; continue; } else if (a[0] == 1 && a[1] ==0&&a[1] == 0&&a[3] == 0) { beq(a[4], a[5], a[6], a[7]); } else if (a[0] == 1 && a[1] == 1 && a[2] == 1 && a[3] == 1) { printf("%d %d %d %d %d %d %d %d\n", reg00, reg01, reg10, reg11, mem00, mem01, mem10, mem11); return 0; } else if (a[0] == 0 && a[1] == 0 && a[2] == 1 && a[3] == 0) { add(a[4], a[5], a[6], a[7]); } else if (a[0] == 0 && a[1] == 0 && a[2] == 1 && a[3] == 1) { mul(a[4], a[5], a[6], a[7]); } else if (a[0] == 0 && a[1] == 0 && a[2] == 0 && a[3] == 1) { save(a[4], a[5], a[6], a[7]); } else if (a[0] == 0 && a[1] == 1 && a[2] == 0 && a[3] == 0) { equal(a[4], a[5], a[6], a[7]); printf("%d\n", equ); } else { load(a[4], a[5], a[6], a[7]); } }