Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- #include <stdbool.h>
- /**
- * Auto-generated code below aims at helping you parse
- * the standard input according to the problem statement.
- **/
- int main()
- {
- int width;
- int height;
- int my_id;
- scanf("%d%d%d", &width, &height, &my_id); fgetc(stdin);
- for (int i = 0; i < height; i++) {
- char line[width + 1];
- fgets(line, width + 1, stdin);
- for(int j = 0; j < width; j++){
- if(line[j] == 'x'){
- fprintf(stderr,"1");
- }
- else{
- fprintf(stderr,"0");
- }
- }
- fprintf(stderr,"\n");
- }
- // Write an action using printf(). DON'T FORGET THE TRAILING \n
- // To debug: fprintf(stderr, "Debug messages...\n");
- printf("7 7\n");
- // game loop
- while (1) {
- int x;
- int y;
- int my_life;
- int opp_life;
- int torpedo_cooldown;
- int sonar_cooldown;
- int silence_cooldown;
- int mine_cooldown;
- scanf("%d%d%d%d%d%d%d%d", &x, &y, &my_life, &opp_life, &torpedo_cooldown, &sonar_cooldown, &silence_cooldown, &mine_cooldown);
- char sonar_result[4];
- scanf("%s", sonar_result); fgetc(stdin);
- char opponent_orders[201];
- fgets(opponent_orders, 201, stdin);
- // Write an action using printf(). DON'T FORGET THE TRAILING \n
- // To debug: fprintf(stderr, "Debug messages...\n");
- printf("MOVE N TORPEDO\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement