Advertisement
Anik_Akash

Id and Ship

May 19th, 2020
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5.     int n, i;
  6.     scanf("%d\n",&n);
  7.  
  8.         for(i=1; i<=n;i++){
  9.         char ch;
  10.         scanf("%c\n", &ch);
  11.         if(ch=='B' || ch=='b'){
  12.             printf("BattleShip\n");
  13.         }
  14.         else if(ch=='C' || ch=='c'){
  15.             printf("Cruiser\n");
  16.         }
  17.         else if(ch=='D' || ch=='d'){
  18.             printf("Destroyer\n");
  19.         }
  20.         else if(ch=='F' || ch=='f'){
  21.             printf("Frigate\n");
  22.         }
  23.     }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement