Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int t,n,m,i,j,k,r,c,p;
- scanf("%d",&t);
- for(i=0;i<t;i++)
- {
- scanf("%d %d %d",&n,&m,&p);
- int ch[n][m];
- for(r=0;r<n;r++)
- {
- for(c=0;c<m;c++)
- {
- scanf("%d",&ch[r][c]);
- }
- }
- if(ch[r][c]==1)
- {
- for(j=1;j<=p;j++)
- {
- ch[r+j][c]==1;
- ch[r-j][c]==1;
- ch[r][c+j]==1;
- ch[r][c-j]==1;
- }
- }
- printf("case #%d:\n",i+1);
- for(r=0;r<n;r++)
- {
- for(c=0;c<m;c++)
- {
- printf("%d",ch[r][c]);
- }
- printf("\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement