Advertisement
Nayeemzaman

Untitled

Nov 3rd, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int i,j,k,t,c=0,ch3[1000];
  5. char ch1,ch2;
  6. scanf("%d",&t);
  7. for(i=0;i<t;i++)
  8. {
  9. scanf(" %c",&ch1);
  10. if(ch1=='S')
  11. {
  12. for(j=0;j<901;j++)
  13. {
  14. scanf(" %c",&ch2);
  15. if(ch2=='E')break;
  16. else
  17. {
  18. if(ch2=='-'){
  19. ch3[j]=1;
  20. }
  21. else if(ch2=='|'){
  22. ch3[j]=2;
  23. }
  24. c++;
  25. }
  26. }
  27. }
  28. for(k=0;k<c;k++)
  29. {
  30. if(ch3[k]==1)
  31. printf("R");
  32. if(ch3[k]==2)
  33. printf("D");
  34. }
  35. c=0;
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement