왜 Wrong Answer 뜰까요?ㅠㅠㅠ

chung1685 Reply 9 years 2 weeks ago
#include <stdio.h> #include <stdlib.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char *argv[]) { int n, i, sum[100], gap[100], a[100], b[100], c[100]; scanf("%d", &n); for(i=0; i<n; ++i){ scanf("%d %d", &sum[i], &gap[i]); a[i] = (sum[i]+gap[i])/2; b[i] = sum[i] - a[i]; c[i] = (sum[i]+gap[i])%2; } for(i=0; i<n; ++i){ if (a[i] >= 0 && b[i] >= 0){ printf("%d %d", a[i], b[i]); } else if (c[i] = 1 || a[i]<0 || b[i]<0) printf("impossible"); printf("\n"); } return 0; } 이렇게 짯는데 왜 안 되는지 모르겠어요 ㅠㅠ 제 꺼에선 잘만 되는데요 ㅠㅠㅠㅠㅠ
booksky Reply 9 years 2 weeks ago
해결하셨네요. 축하드립니다.