#include <stdio.h>
#include <string.h>

#define DATA_SIZE 6

struct ticket_reserve {
  char name[30];
  char depart_code[4]; //depart=出発　3桁のコード
  char arrive_code[4]; //arrive=到着
  // char depart_time[8]; //出発時刻　例：12220302 = 12月22日3月2日
  // char arrive_time[8]; //到着時刻
  char depart_time[9]; //出発時刻　例：12220302 = 12月22日3月2日
  char arrive_time[9]; //到着時刻
};


struct ticket_reserve ticket_date[DATA_SIZE] = {
  {"美しい海便", "ac2", "gt6", "12220302", "12230304"},
  {"風が気持ちいい便", "ac2", "df7", "12220502", "12220503"},
  {"夏を感じる便", "de4", "iu8", "04021211", "04021213"},
  {"寒いけど心が引き締まる便","3e2", "te2", "01110825", "01110827"},
  {"真夏の夜を感じる便", "ff4", "ff9", "08250101", "08250106"},
  {"ネタがねぇ便", "gt6", "gr2", "06311112", "06311114"}
};

char search_depart_code1[4] = "ac2";
char search_depart_code2[4] = "de4";

int main(void)
{
  int i;
  for ( i=0; i<=DATA_SIZE - 1; i++) {
    // if( ticket_date[i].depart_code == search_depart_code1)
    if(strncmp(ticket_date[i].depart_code, search_depart_code1, sizeof(search_depart_code1)) == 0)
      printf("出発便[%s]を見つけました！:出発コード%s\n", ticket_date[i].name, ticket_date[i].depart_code);

    // if( ticket_date[i].depart_code == search_depart_code2)
    if(strncmp(ticket_date[i].depart_code, search_depart_code2, sizeof(search_depart_code2)) == 0)
      printf("出発便[%s]を見つけました！:出発コード%s\n", ticket_date[i].name, ticket_date[i].depart_code);
  }

  // getchar();
  return 0;
}
