ÇÁ·Î±×·¡¹Ö

 3204, 155/161 ȸ¿ø°¡ÀÔ  ·Î±×ÀΠ 
   ¼ÒÀ¯
   http://soyu.cafe2.net
   [re] ¹¹°¡ À߸øµÈ°ÇÁö ºÁÁÖ¼¼¿ä

http://www.hackerschool.org/HS_Boards/zboard.php?id=QNA_programming&no=34 [º¹»ç]


>visual c++¿¡¼­ Çߴµ¥ ¿À·ù 14°³Á¤µµ ¤Ñ.¤Ñ
>
>#include <stdio.h>
>
>#define MAX 100
>#define YES 1
>#define NO 0
>
>long income[MAX];
>int month[MAX],day[MAX],year[MAX];
>int x,y,ctr;
>int cont;
>long month_total, grand_total;
>void main(void);
>int display_instructions(void);
>void get_data(void);
>void display_report(void);
>int continue_function(void);
>
>
>
>void main(void)
>{
>        cont=display_instructions();
>        if(cont==yes)
>        {
>                get_data();
>                display_report();
>        }
>        else
>                printf("\nProgram aborted by user!\n\n");
>}
>
>
>
>
>int display_instructions(void)
>{
>        printf("\n\n");
>        printf("nThis program enables you to enter up to 99 peple\'s");
>        printf("\nincomes and birthdays. It then prints the incomes by");
>        printf("\nmonth along with the overall income and overall average.");
>        printf("\n");
>        cont= continue_function();
>        return (cont);
>}
>
>void get_data(void)
>{
>        for(cont=YES,ctr=0;ctr<MAX && cont==YES; ctr++)
>        {
>                printf("\nEnter information for Person %d", ctr+1);
>                printf("\n\tEnter Birthday: ");
>
>                do
>                {
>                        printf(\n\tMonth (0 - 12) : ");
>                        scanf("%d", &month[ctr]);
>                }while (month[ctr} < 0 || month[ctr] > 12);
>                
>                do
>                {
>                        printf("\n\tDay (0 - 31): ");
>                        scanf("%d", &day[ctr]);
>                }while (day[ctr] < 0 || month[ctr] > 31);
>                
>                do
>                {
>                        printf("\n\tYear (0 - 1997): ");
>                        scanf("%d", &year[ctr]);
>                }
>                while (year[ctr] < 0 || year[ctr] > 1997);
>
>                printf("\nEnter Yearly Income (whole dollars): ");
>                scanf("%ld", &income[ctr]);
>                
>                cont = continue_function();
>        }
>}
>
>void display_report()
>{
>        grand_total=0;
>        printf("\n\n\n");
>        printf("\n                SALARY SUMMARY");
>        printf("\n                ===============");
>
>        for(x=0; x<=12; x++)  
>        {
>                month_total=0;
>                for(y=0; y<ctr; y++)
>                {
>                        if(month[y]==x)
>                                month_total+=income[y];
>                }
>                printf("\nTotal for month %d is %ld", x, month_total);
>                grand_total+=month_total;
>        }
>        printf("\nReport totals: ");
>        printf("\nToTal Income is %ld", grand_total);
>        printf("\nAverage Income is %ld", grand_total/ctr);
>
>        printf("\n\n* * * End of Report * * *\n");
>}
>
>int continue_function(void)
>{
>        printf("\n\nDo You Wish to continue? (0=NO/1=YES): ");
>        scanf("%d", &x);
>
>        while(x<0 || x>1)
>        {
>                printf(\n%d is invalid!",x);
>                printf(\nPlease enter 0 to quit or 1 to continue: ");
>                scanf("%d",&x);
>        }
>        if(x==0)
>                return(NO);
>        else
>                return(YES);
>}
>


        while(x<0 || x>1)
       {
                printf(\n%d is invalid!",x);
                printf(\nPlease enter 0 to quit or 1 to continue: ");
              scanf("%d",&x);
      }

À§¿¡¼­ ½Öµû¿ÈÇ¥ ºüÁ³À½...

  Hit : 4608     Date : 2003/09/09 09:26



    
yl Àú·±°Å¶§¸Þ ¿¡·¯³ª¸é Á¤¸» °ñÄ¡¾ÆÇÅ´Ï´Ù ¤»¤» 2003/09/10  
pinix1234 Â÷±ÙÂ÷±Ù ¿¡·¯ÇØ°áÇÏ½Ã¸é µÇ¿ä ¤¾¤¾¤¾¤¾ Èû³»»ï ¤¾¤¾ 2010/04/28  
124     [re] Áú¹®ÀÌ¿µ     ¼ÒÀ¯
09/13 4678
123     [re] °í¹Î..     ¼ÒÀ¯
09/13 4113
122     [re] ±â´É»çÇÏ°í ±â»çÇÏ°í Â÷ÀÌÁ¡ÀÖ³ª¿µ?     ¼ÒÀ¯
09/13 4989
121     [re] memset() ÇÔ¼öÁ» ¾ËÄÑÁÖ¼¼¿ë^^     ¼ÒÀ¯
09/13 6394
120     [re] ÇØÄð ¸Þ´º¾ó C¾ð¾î Æí.. ÆäÀÌÁö 24ÂÊ °ü·Ã Áú¹®..[1]     ¼ÒÀ¯
09/13 4729
119     [re] ~~~ÀÌ°ÍÁ» °¡¸®ÄÑ ÁÖ¼¼¿ä!!~~~ ½ÇÇàÀÌ ¾ÈµÇ¿ä ¤Ð.¤Ì     ¼ÒÀ¯
09/14 4613
118     [re] ¾Æ¿õ~ »êÀÌ ³ô´ÙÇ쵂 µöµû ³ô±¸³ª[1]     ¼ÒÀ¯
09/14 4717
117     [re] C¾ð¾î¿Í ¸®´ª½º Ã¥ Á» ÃßõÇØÁֽñæ...[1]     ¼ÒÀ¯
09/18 5274
116     [re] Áú¹®ÀÔ´Ï´Ù.     ¼ÒÀ¯
09/19 4449
115     [re] CÀÔ¹®ÀÚÀ© ¤Ì¤Ì ´Ù½Ã..[1]     ¼ÒÀ¯
10/01 4861
114     [re] ºñÁÖ¾ó C++ 6.0 ´Ù¿î¹ÞÀ»¼öÀÖ³ª¿µ?     ¼ÒÀ¯
10/12 10342
113     [re] ¹¹°¡ À߸ø 됬´ÂÁö Àß ¸ð¸£°Ú¾î¿ä ¤Ð,.¤Ì[4]     ¼ÒÀ¯
03/01 3023
112     [re] ¾È³çÇϼ¼¿ä^^..     ¼ÒÀ¯
06/02 2811
111     [re] ¾î¼Àºí¸®¾î¸¦ ¹è¿ì·Á°íÇÕ´Ï´Ù.[2]     ¼ÒÀ¯
09/21 2726
110     [re] ¿¡..¸®´ª½ºÇØÅ·À» ÇÒ·Á¸é ¹» ¹è¿öµÖ¾ß ÇÒ±î¿ä     ¼ÒÀ¯
10/06 2834
109   [c¾ð¾î] °è»ê±â ¿À·ù¼öÁ¤[2]     ¼Õ°Ç
01/23 4227
108   ÆÄÀ̼± ¹Ýº¹¹®°ú ¸®½ºÆ® Áú¹®[1]     ¼Õ°Ç
01/12 3223
107   Á¦°¡ Çѹø °­Á ±×´ë·Î µû¶óÇØ”f´Âµ¥,,[4]     ¼Ò³à½Ã´ë
02/04 3302
106   âÀÌ 1Ãʵµ ¾ÈµÇ¼­ »ç¶óÁ®¿ä -¤±-[5]     ¼Ò³à½Ã´ë
02/04 3021
105   for¹® ¿¬½ÀÁßÀε¥,, ´äÀÌ ´Ù¸£°Ô ³ª¿Í¼­¿ä,[2]     ¼Ò³à½Ã´ë
02/05 2636
[1]..[151][152][153][154] 155 [156][157][158][159][160]..[161]

Copyright 1999-2024 Zeroboard / skin by Hackerschool.org / Secure Patch by Hackerschool.org