22018, 1/1101 ȸ¿ø°¡ÀÔ  ·Î±×ÀΠ 
   imom
   c++Áú¹®

http://www.hackerschool.org/HS_Boards/zboard.php?AllArticle=true&no=33244 [º¹»ç]


Á¦°¡ ÇöÀç Â¥°í ÀÖ´Â ÄÚµåÀÔ´Ï´Ù ¿©±âº¸¸é goto main(1); À» ³Ö¾î³ù´Âµ¥
goto ¸»°í ´Ù¸¥°Å ¾µ¼ö ÀÖ³ª¿ä? ¶Ç µð¹ö±ëÀ»ÇÏ´Ï ¾ÈµÇ¼­ ÀÌÄڵ忡 ¹ö±×°¡ ÀÖ´ÂÁö È®ÀÎÇØÁÖ¼ÌÀ¸¸é ÇÕ´Ï´Ù.
#include <stdio.h>
#include <iostream.h>
#include <stdlib.h>

double main()
{
        double select;
      printf("DOS version : 0.12/1 Alpha\n");
          printf("DOS\n");
      cin>>select;
      if(select==1)
{
      printf("\n1:¸í·É¾î ³ëµå \n");
      printf("2:»çÄ¢¿¬»ê \n");
          printf("3:ipconfig \n");
          printf("4:chkdsk \n");
          printf("5:date \n");
          printf("6:time \n");
                                     printf("If you want to goto main. select 1!\n");
          printf("1. goto main 2. end\n");
          cin>>select;
          if(select==1)
          {
                  goto main(1);
          }
          else if(select==2)
          {
                  printf("exiting...");
      return 0;
          }

}
      else if(select==2)
{
      double select,a,b;
    cout<<"°è»ê±â\n"<<endl;
    cout<<"¿øÇϴ°è»êÀ» ¼±ÅÃÇϽÿÀ. ¼Ò¼ýÁ¡Àº ÀÔ·ÂÇÏÁö ¸¶½Ã¿À.\n"<<endl;
    cout<<"1. µ¡¼À 2. »¬¼À 3. °ö¼À 4. ³ª´°¼À      \n"<<endl;
    cin>>select;
    if(select==1)
    {
         cout<<"µ¡¼ÀÇÒ µÎ ¼ýÀÚ¸¦ ¾²½Ã¿À.\n"<<endl;
         cin>>a>>b;
         cout<<a<<" + "<<b<<" = "<<a+b<<" \n"<<endl;
                       printf("If you want to goto main. select 1!\n");
          printf("1. goto main 2. end\n");
          cin>>select;
          if(select==1)
          {
                  goto main(1);
          }
          else if(select==2)
          {
                  printf("exiting...");
      return 0;
          }
        }
    else if(select==2)
    {
         cout<<"»¬¼ÀÇÒ µÎ ¼ýÀÚ¸¦ ¾²½Ã¿À.\n"<<endl;
         cin>>a>>b;
         cout<<a<<" - "<<b<<" = "<<a-b<<" \n"<<endl;
                       printf("If you want to goto main. select 1!\n");
          printf("1. goto main 2. end\n");
          cin>>select;
          if(select==1)
          {
                  goto main(1);
          }
          else if(select==2)
          {
                  printf("exiting...");
      return 0;
          }
     }
     else if(select==3)
    {
         cout<<"°ö¼ÀÇÒ µÎ ¼ýÀÚ¸¦ ¾²½Ã¿À.\n"<<endl;
         cin>>a>>b;
         cout<<a<<" * "<<b<<" = "<<a*b<<" \n"<<endl;
                       printf("If you want to goto main. select 1!\n");
          printf("1. goto main 2. end\n");
          cin>>select;
          if(select==1)
          {
                  goto main(1);
          }
          else if(select==2)
          {
                  printf("exiting...");
      return 0;
          }
     }
     else if(select==4)
    {
         cout<<"³ª´°¼ÀÇÒ µÎ ¼ýÀÚ¸¦ ¾²½Ã¿À. 0À¸·Î´Â ¸ø ³ª´®´Ï´Ù.\n"<<endl;
         cin>>a>>b;
         if(b==0)
        {
              cout<<"0À¸·Î´Â ³ª´­ ¼ö ¾ø½À´Ï´Ù.\n"<<endl;
                               printf("If you want to goto main. select 1!\n");
          printf("1. goto main 2. end\n");
          cin>>select;
          if(select==1)
          {
                  goto main(1);
          }
          else if(select==2)
          {
                  printf("exiting...");
      return 0;
          }
         }
         cout<<a<<" / "<<b<<" = "<<a/b<<" \n"<<endl;
                       printf("If you want to goto main. select 1!\n");
          printf("1. goto main 2. end\n");
          cin>>select;
          if(select==1)
          {
                  goto main(1);
          }
          else if(select==2)
          {
                  printf("exiting...");
      return 0;
          }
     }
    else
    {
         cout<<"¿Ã¹Ù¸¥ ¼ýÀÚ¸¦ ÀÔ·ÂÇϽÿÀ.\n"<<endl;
               printf("If you want to goto main. select 1!\n");
          printf("1. goto main 2. end\n");
          cin>>select;
          if(select==1)
          {
                  goto main(1);
          }
          else if(select==2)
          {
                  printf("exiting...");
      return 0;
          }
                                       

     }
return 0;
}
         else if(select==3)
{
         system( "ipconfig" );
               printf("If you want to goto main. select 1!\n");
          printf("1. goto main 2. end\n");
          cin>>select;
          if(select==1)
          {
                  goto main(1);
          }
          else if(select==2)
          {
                  printf("exiting...");
      return 0;
          }
                                 
}
         else if(select==4)
{
                         system( "chkdsk" );
                                        printf("If you want to goto main. select 1!\n");
          printf("1. goto main 2. end\n");
          cin>>select;
          if(select==1)
          {
                  goto main(1);
          }
          else if(select==2)
          {
                  printf("exiting...");
      return 0;
          }
}
         else if(select==5)
{
                         system( "data" );
                                        printf("If you want to goto main. select 1!\n");
          printf("1. goto main 2. end\n");
          cin>>select;
          if(select==1)
          {
                  goto main(1);
          }
          else if(select==2)
          {
                  printf("exiting...");
      return 0;
          }
}
                 else if(select==6)
{
                         system( "time" );
               printf("If you want to goto main. select 1!\n");
          printf("1. goto main 2. end\n");
          cin>>select;
          if(select==1)
          {
                  goto main(1);
          }
          else if(select==2)
          {
                  printf("exiting...");
      return 0;
          }
}
                 return 0;
}

  Hit : 8915     Date : 2015/03/28 09:42



    
imom ¾Ë¾Æº¸±â ¾î·Á¿ì¸é Á˼ÛÇÕ´Ï´Ù. 2015/03/28