ÇÁ·Î±×·¡¹Ö

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

http://www.hackerschool.org/HS_Boards/zboard.php?desc=desc&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 : 4666     Date : 2003/09/09 09:26



    
yl Àú·±°Å¶§¸Þ ¿¡·¯³ª¸é Á¤¸» °ñÄ¡¾ÆÇÅ´Ï´Ù ¤»¤» 2003/09/10  
pinix1234 Â÷±ÙÂ÷±Ù ¿¡·¯ÇØ°áÇÏ½Ã¸é µÇ¿ä ¤¾¤¾¤¾¤¾ Èû³»»ï ¤¾¤¾ 2010/04/28  
2904     [re] char ÇüÀÇ º¯¼ö¿¡ ¹®ÀÚ ´ëÀÔÇϴ¹æ¹ýÁ»..(±×¿Ü µîµî)[2]     ¾ÆÀÌÇÁ¸®µå
08/10 4675
2903   [C¾ð¾î] C¾ð¾î ¿¡·¯ Áú¹®ÀÌ¿ä..;¤µ;[5]     minyang
04/05 4674
2902   Åͺ¸c ¸»Àä À©µµ¿ì7¿¡¼­´Â ¾ÊµÇ³ª¿ä?[1]     gkswls123
09/06 4668
2901   visual studio 2010 express ¿¡ ´ëÇؼ­¿ä[5]     gkswls123
08/15 4667
    [re] ¹¹°¡ À߸øµÈ°ÇÁö ºÁÁÖ¼¼¿ä[2]     ¼ÒÀ¯
09/09 4665
2899     [re] ~~~ÀÌ°ÍÁ» °¡¸®ÄÑ ÁÖ¼¼¿ä!!~~~ ½ÇÇàÀÌ ¾ÈµÇ¿ä ¤Ð.¤Ì     ¼ÒÀ¯
09/14 4663
2898   [C++]¹®ÀÚÀÔ·Â+Ä¿¼­À̵¿ Áú¹®Á»ÇÒ°Ô¿ä¤Ì¤Ì[1]     yjh2888
11/30 4659
2897   º¸¾ÈÀü¹®°¡ ÂÊ ¾ð¾î ¼ø¼­Á» Àâ¾ÆÁÖ¼¼¿ä.[4]     hjt7942
07/10 4654
2896   Àü¿ªº¯¼ö¶§¸Å ¹ÌÄ¡°Ù¾î¿ä µµ¿ÍÁÖ¼¼¿ä ¤»¤Ì¤Ì[3]     ±×´Ï
11/18 4643
2895   2ÀÇ n½Â Ãâ·ÂÇÏ´Â°É ¸¸µå´Âµ¥¿ä..;[2]     ahotsuna
09/18 4638
2894   JAVA ÄÚµå¾ÆÄ«µ¥¹Ì °ü·ÃÇؼ­ ¿©Â庾´Ï´Ù[3]     king1706
04/20 4634
2893   ¹è¿­¿¡ ´ëÇؼ­[7]     3cushion
10/04 4616
2892   C¾ð¾î¿¡ ´ëÇؼ­...[2]     sobos103
09/08 4612
2891   c¾ð¾î Áú¹®ÀÌ¿ä[4]     goldbear564
03/05 4611
2890   ÀÚ¹Ù ÇÁ·Î±×·¡¹Ö °è»ê±â ÇÁ·Î±×·¥ Áú¹®µå¸³´Ï´Ù.[2]     daze1234
10/27 4610
2889     [re] ±â´É»çÇÏ°í ±â»çÇÏ°í Â÷ÀÌÁ¡ÀÖ³ª¿µ?     hw0arang
09/09 4610
2888     [re] Á¦·Îº¸µå¿¡¼­ ¾ÏȣȭµÈ.. ºñ¹øÀ» º¹¿øÇÒ¼ö¾øÀ»±î¿ä?     h41d35
12/18 4604
2887   c¸¦ ÇÁ·Î±×·¡¹ÖÇϴµ¥ ¼º°øÇߴµ¥ ±×°Ô ¹«½Ã¹«½ÃÇÑ ¼Óµµ·Î ²¨Á®¿ä[4]     worldsky1
01/24 4603
2886   c¾ð¾î ±×·¡ÇÈÇÔ¼ö¿Í »ç¿ë¹ýÀ» ¾Ë·ÁÁÖ¼¼¿ä     ts930803
02/07 4602
2885   ÁÖ¼Ò°ª¿¡ °ü·ÃµÈ Áú¹®ÀÔ´Ï´Ù.[2]     PasCraN
10/24 4602
[1]..[11][12][13][14][15] 16 [17][18][19][20]..[161]

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