|
|
back to boardWhy i get WA? Can anyone tell me why? #include <stdio.h> #include <stdlib.h> #define ONLINE_CONTEST void main() { long n; long nr; int i, x, y, ant, first = 1; #ifndef ONLINE_CONTEST freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); #endif scanf("%ld", &n); nr = 0; for(i = 0; i < n; i++) { scanf("%d%d", &x, &y); x = x + y; if(first) { first = 0; ant = x; } else if(x < 9) { printf("%d", ant); for(y = 0; y < nr;y++) { printf("9"); } ant = x; nr=0; } else if(x == 9) { nr++; } else if(x > 9) { printf("%d", ant+1); for(y = 0; y < nr; y++) { printf("0"); } ant = x % 10; nr = 0; } } if(!first) printf("%d", ant); } |
|
|