Advertisement
Nayeemzaman

Untitled

Nov 5th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int t,n,m,i,j,k,r,c,p;
  5. scanf("%d",&t);
  6. for(i=0;i<t;i++)
  7. {
  8. scanf("%d %d %d",&n,&m,&p);
  9. int ch[n][m];
  10. for(r=0;r<n;r++)
  11. {
  12. for(c=0;c<m;c++)
  13. {
  14. scanf("%d",&ch[r][c]);
  15. }
  16. }
  17. if(ch[r][c]==1)
  18. {
  19. for(j=1;j<=p;j++)
  20. {
  21. ch[r+j][c]==1;
  22. ch[r-j][c]==1;
  23. ch[r][c+j]==1;
  24. ch[r][c-j]==1;
  25. }
  26. }
  27. printf("case #%d:\n",i+1);
  28. for(r=0;r<n;r++)
  29. {
  30. for(c=0;c<m;c++)
  31. {
  32. printf("%d",ch[r][c]);
  33. }
  34. printf("\n");
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement