# রোবট সমস্যা

 0 সুবিন ভাইয়ের রোবট সমস্যাটি সমাধানে কেউ সাহায্য করুন। ব্লক্‌ড সেলের পর এক ঘর অটো শিফট হচ্ছে। ``````#include int main() { int grid [10][10]; char c; int i,j,x,y,n; for(i=0;i<10;i++){ for(j=0;j<10;j++){ grid[i][j]=1; } } printf("Please enter the number of blocked cells: "); scanf("%d",&n); printf("Now enter the the cells: "); for(i=0;i=0 && x<10 && y>=0 && y<10 && grid[x][y]==1){ scanf("%c",&c); if(c=='S'){ break; } else if(c=='U'){ x--; } else if(c=='D'){ x++; } else if(c=='R'){ y++; } else if(c=='L'){ y--; } } else if(grid[x][y]==0) { printf("the cell is blocked"); if(c=='S'){ break; } else if(c=='U'){ x--; } else if(c=='D'){ x++; } else if(c=='R'){ y++; } else if(c=='L'){ y--; } } } printf("Final position of the robot is : %d, %d\n",x,y); return 0; } `````` asked 18 Oct '18, 21:11 Sayem 21●2 (19 Oct '18, 15:18) Sayem
Be the first one to answer this question!
 toggle preview community wiki:

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Question tags:

×418
×1

question asked: 18 Oct '18, 21:11

question was seen: 933 times

last updated: 19 Oct '18, 15:18