Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main(void)
  5. {
  6.  
  7.  
  8. int x, a = 0,b = 3,c;
  9. char y;
  10. char north = "north",east = "east",west = "west",south = "south";
  11.  
  12.  
  13. printf("The submarine is hiding at the ocean floor. \n Try to sink it before you run out of depth charges.");
  14. scanf("%s%lf\n",&y,&x );
  15.  
  16.  
  17. while (a != 5) {
  18. if (x != b) {
  19. printf("Miss. Sonar indicates that the submarine is located Somewhere\n", );
  20. } else {
  21. switch (y) {
  22. case 'a':
  23. break;
  24.  
  25. case 'b':
  26. break;
  27.  
  28. case 'c':
  29. break;
  30.  
  31. case 'd':
  32. break;
  33.  
  34. case 'e':
  35. break;
  36.  
  37. case 'f':
  38. break;
  39. case 'g':
  40. break;
  41.  
  42. case 'h':
  43. break;
  44.  
  45. case 'i':
  46. break;
  47.  
  48. case 'j':
  49. break;
  50.  
  51. }
  52. }
  53. }
  54.  
  55.  
  56.  
  57.  
  58. return 0;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement