fork download
  1. #include <stdio.h>
  2. int main() {
  3. for (char i = 0, t, s = 0, x = 1, tmp; i < 10; i++, puts(""), s &= 1)
  4. for (char j = 0; j < 10; j++) {
  5. scanf("%hhd", &t);
  6. tmp = (!t || t == 2) && !s && j >= x;
  7. printf("%hhd ", tmp ? 9 : t);
  8. t == 2 && tmp ? s = 1 : 0;
  9. t&& i && !s && j > x ? s = 2, x = j - 1 : 0;
  10. }
  11. return 0;
  12. }
  13. //코드줄이기하청업체위탁생산전문담당1학년2반10번이정혁워터마크박고감
Success #stdin #stdout 0s 5316KB
stdin
1 1 1 1 1 1 1 1 1 1
1 0 0 1 0 0 0 0 0 1
1 0 0 1 1 1 0 0 0 1
1 0 0 0 0 0 0 1 0 1
1 0 0 0 0 0 0 1 0 1
1 0 0 0 0 1 0 1 0 1
1 0 0 0 0 1 2 1 0 1
1 0 0 0 0 1 0 0 0 1
1 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1
stdout
1 1 1 1 1 1 1 1 1 1 
1 9 9 1 0 0 0 0 0 1 
1 0 9 1 1 1 0 0 0 1 
1 0 9 9 9 9 9 1 0 1 
1 0 0 0 0 0 9 1 0 1 
1 0 0 0 0 1 9 1 0 1 
1 0 0 0 0 1 9 1 0 1 
1 0 0 0 0 1 0 0 0 1 
1 0 0 0 0 0 0 0 0 1 
1 1 1 1 1 1 1 1 1 1