Advertisement
MUstar

IoT C++ 09/08 - 팀프로젝트V1

Sep 8th, 2017
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.13 KB | None | 0 0
  1. #include<iostream>
  2. #include<ctime>
  3. #include<string.h>
  4. #include<stdlib.h>
  5. #include<conio.h>
  6. #include<windows.h>
  7. #include<fstream>
  8.  
  9. using namespace std;
  10. void Nation_list(void);
  11. void Korea(void);
  12. void search(char input[]);
  13.  
  14. class Nation //'국가' 클래스화
  15. {
  16.    public :
  17.       char Name[10]; //국가 이름
  18.       char Capital[10];//수도
  19.       char Language[20];
  20.       char President[20];//국가 원수 이름
  21.       long Population; //인구
  22.       char GDP[10]; //GDP
  23. };//메인함수의 인터페이스
  24.  
  25.  
  26.  
  27.  
  28.  
  29. int main(void)
  30. {
  31.    char input[10];
  32.    Nation_list();
  33.    cout<<"선택 : ";
  34.    cin>>input;
  35.    search(input);
  36.    
  37.    return 0;
  38. }
  39.  
  40. void TimeZone(char *city, int plustime)
  41. {
  42.     int timenow = time(0);
  43.     int tmp = timenow / 86400;
  44.     int s = timenow%60;
  45.     int m = (timenow/60)-(timenow/3600*60);
  46.     int h = ((timenow/3600)-(tmp*24))+plustime;
  47.     //int bh = ((timenow+plustime)/3600)-(tmp*24);
  48.     if(h>=24) h-=24;
  49.     else if(h<0) h+=24
  50.     cout<<"대한민국시간 : "<<h<<":"<<m<<":"<<s<<endl;
  51.     Sleep(1000);
  52. }
  53.  
  54. void search(char input[])
  55. {
  56.    if(strcmp(input,"대한민국")==0) Korea();
  57.    else if(strcmp(input,"대한민국")==0) Korea();
  58.    else if(strcmp(input,"대한민국")==0) Korea();
  59.    else if(strcmp(input,"대한민국")==0) Korea();
  60.    else if(strcmp(input,"대한민국")==0) Korea();
  61.    else if(strcmp(input,"대한민국")==0) Korea();
  62.    else if(strcmp(input,"대한민국")==0) Korea();
  63.    else if(strcmp(input,"대한민국")==0) Korea();
  64.    else if(strcmp(input,"대한민국")==0) Korea();
  65.    else if(strcmp(input,"대한민국")==0) Korea();
  66.    else if(strcmp(input,"대한민국")==0) Korea();
  67.    else if(strcmp(input,"대한민국")==0) Korea();
  68.    else if(strcmp(input,"대한민국")==0) Korea();
  69.    else if(strcmp(input,"대한민국")==0) Korea();
  70.    else if(strcmp(input,"대한민국")==0) Korea();
  71.    else if(strcmp(input,"대한민국")==0) Korea();
  72.    else if(strcmp(input,"대한민국")==0) Korea();
  73.    else if(strcmp(input,"대한민국")==0) Korea();
  74.    else if(strcmp(input,"대한민국")==0) Korea();
  75.    else if(strcmp(input,"대한민국")==0) Korea();
  76.    else if(strcmp(input,"대한민국")==0) Korea();
  77.    else if(strcmp(input,"대한민국")==0) Korea();
  78.    else if(strcmp(input,"대한민국")==0) Korea();
  79.    else if(strcmp(input,"대한민국")==0) Korea();
  80.    else if(strcmp(input,"대한민국")==0) Korea();
  81.    else if(strcmp(input,"대한민국")==0) Korea();
  82.    else if(strcmp(input,"대한민국")==0) Korea();
  83.    else if(strcmp(input,"대한민국")==0) Korea();
  84.    else if(strcmp(input,"대한민국")==0) Korea();
  85.    else if(strcmp(input,"대한민국")==0) Korea();
  86.    else if(strcmp(input,"대한민국")==0) Korea();
  87.    else if(strcmp(input,"대한민국")==0) Korea();
  88.    else if(strcmp(input,"대한민국")==0) Korea();
  89.    else if(strcmp(input,"대한민국")==0) Korea();
  90.    else Korea();
  91. }
  92.  
  93. void Nation_list(void)
  94. {
  95.    cout<<"            ,:;;~,         .                                                                       "<<endl;
  96.    cout<<"        ~;;;::::~~~~~,      -    -                                                                 "<<endl;
  97.    cout<<"      ;!;:~;~~~,-~~~~~~.    --   ---          ,;!!!;-     ~;;;;;;;;;;    .~!!!!;-    ;;;;;;:-.      "<<endl;
  98.    cout<<"     !!!:--,,..~~~    ,.:   ---, .---       !!!.   .!!!   ~!           .!!;.   -!!;  !!    .:!!;    "<<endl;
  99.    cout<<"    :--~--,,,..~---~   ,,,   ---  .---    .;!         !!. ~!          !!;            !!       -!!,  "<<endl;
  100.    cout<<"    ;!~~--,,,-,,~~-~  .~::    --:   -;    !!           !! ~!          !!             !!        ,!!  "<<endl;
  101.    cout<<"     ~:~:-!-;.;~~~~~~~ ~-::     !:   ;;   !!           !! ~!;;;;;;;; .!!             !!         !! "<<endl;
  102.    cout<<"    !;~-;;;:-,--~~:~~~:,,:   :!;:  ;;!    :!-         -!; ~!          !!.            !!        !!;  "<<endl;
  103.    cout<<"     !~!!!;;;,--~::::::,,   ;!!!  !!!      ;!;       !!;  ~!           !!:       :,  !!      .!!;   "<<endl;
  104.    cout<<"       !!;!;!;;;:;;:;;;;~   ,!!:  !!!        ;!!!!!!!~    ~!!!!!!!!!!   .!!!!!!!!;   !!!!!!!!!     "<<endl;
  105.    cout<<"       .!;;;!!;;;;;;;!     ,!    !!                                                                "<<endl;
  106.    cout<<"          ,!;;;!;!!,       ,     !                                                                 "<<endl;  
  107.     cout<<"그리스    "<<" 네덜란드  "<<" 노르웨이"<<endl;
  108.     cout<<"뉴질랜드  "<<" 대한민국  "<<" 덴마크"<<endl;
  109.     cout<<"독일      "<<" 라트비아  "<<" 룩셈부르크"<<endl;
  110.     cout<<"멕시코    "<<" 미국      "<<" 벨기에"<<endl;
  111.     cout<<"스웨덴    "<<" 스위스    "<<" 스페인"<<endl;
  112.     cout<<"슬로바키아"<<" 슬로베니아"<<" 아이슬란드"<<endl;
  113.     cout<<"아일랜드  "<<" 에스토니아"<<" 영국"<<endl;
  114.     cout<<"오스트리아"<<" 이스라엘  "<<" 이탈리아"<<endl;
  115.     cout<<"일본      "<<" 체코      "<<" 칠레"<<endl;
  116.     cout<<"캐나다    "<<" 터키      "<<" 포르투갈"<<endl;
  117.     cout<<"폴란드    "<<" 프랑스    "<<" 필란드"<<endl;
  118.     cout<<"헝가리    "<<" 호주      "<<endl;
  119. }
  120.  
  121. void Korea(void)
  122. {
  123.    Nation Korea = {"대한민국","서울","한국어","문재인",51753820,"1조4981억"}; //인터페이스를 참고하여 한국의 대한 데이터
  124.    while(1)
  125.    {
  126.       system("cls");
  127.       cout<<"나라이름 : "<<Korea.Name<<endl;//인터페이스를 통한 접근    
  128.       cout<<"수도이름 : "<<Korea.Capital<<endl;
  129.       cout<<"공식언어 : "<<Korea.Language<<endl;
  130.       cout<<"국가원수 : "<<Korea.President<<"대통령"<<endl;
  131.       cout<<"인구수   : "<<Korea.Population<<"명"<<endl;
  132.       cout<<"GDP      : "<<Korea.GDP<<"$"<<endl;
  133.       TimeZone(Korea.Name,9);
  134.       Sleep(500);
  135.       if(kbhit()==1) break;
  136.    }
  137.  
  138.  
  139. /* 파일 입출력부분과 시계출력과 충돌하는 부분이 있어 연구하고 있었습니다.
  140. void Korea(void)
  141. {
  142.    string file="korea.txt";
  143.      
  144.    ifstream open(file.data());
  145.    if(open.is_open()){
  146.       string line;
  147.       while(getline(open,line)){
  148.          cout<<line<<endl;
  149.       }
  150.       open.close();
  151.    }
  152. }
  153. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement