Advertisement
Guest User

Untitled

a guest
Mar 20th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include <stdbool.h>
  5.  
  6. /**
  7. * Auto-generated code below aims at helping you parse
  8. * the standard input according to the problem statement.
  9. **/
  10.  
  11. int main()
  12. {
  13. int width;
  14. int height;
  15. int my_id;
  16. scanf("%d%d%d", &width, &height, &my_id); fgetc(stdin);
  17. for (int i = 0; i < height; i++) {
  18. char line[width + 1];
  19. fgets(line, width + 1, stdin);
  20. for(int j = 0; j < width; j++){
  21. if(line[j] == 'x'){
  22. fprintf(stderr,"1");
  23. }
  24. else{
  25. fprintf(stderr,"0");
  26. }
  27. }
  28. fprintf(stderr,"\n");
  29. }
  30.  
  31. // Write an action using printf(). DON'T FORGET THE TRAILING \n
  32. // To debug: fprintf(stderr, "Debug messages...\n");
  33.  
  34. printf("7 7\n");
  35.  
  36. // game loop
  37. while (1) {
  38. int x;
  39. int y;
  40. int my_life;
  41. int opp_life;
  42. int torpedo_cooldown;
  43. int sonar_cooldown;
  44. int silence_cooldown;
  45. int mine_cooldown;
  46. scanf("%d%d%d%d%d%d%d%d", &x, &y, &my_life, &opp_life, &torpedo_cooldown, &sonar_cooldown, &silence_cooldown, &mine_cooldown);
  47. char sonar_result[4];
  48. scanf("%s", sonar_result); fgetc(stdin);
  49. char opponent_orders[201];
  50. fgets(opponent_orders, 201, stdin);
  51.  
  52. // Write an action using printf(). DON'T FORGET THE TRAILING \n
  53. // To debug: fprintf(stderr, "Debug messages...\n");
  54.  
  55. printf("MOVE N TORPEDO\n");
  56. }
  57.  
  58. return 0;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement