Anik_Akash

Id and Ship

May 19th, 2020
95
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data