ÀÛ¼ºÀÏ : 15-09-10 01:10
ÀÚ±âÁÖµµ c¾ð¾î ÇÁ·Î±×·¡¹Ö ¹è¿­ 1 ÀÚ°¡Áø´Ü 8¹ø
 ±Û¾´ÀÌ : °øÅÂÇö(kth119879)
Á¶È¸ : 4,340  

#include <stdio.h>
int main()
{
    int a[10];
    int i;
    int suma=0;
    double avg;
    int sumb=0;

    for (i = 0 ; i < 10 ; i++) {
        scanf("%d", &a[i]);
        if(i % 2 == 0 || i == 0) {
           a[i] += sumb;}
        if(i % 2 == 1) {
           a[i] += suma;
           }
            }
    avg = sumb / 5.0;
    printf("¦¼ö¹ø° ÇÕ : %d\n", suma);
    printf("Ȧ¼ö¹ø° Æò±Õ : %.1lf", avg);
    return 0;
}

·Î Çߴµ¥ °á°ú°ªÀÌ 0ÀÌ ¶°¿ä.

¾îµð°¡ À߸øµÈ °Ç °¡¿ä?


ÄĽºÄð 15-09-10 17:06
 
µð¹ö±ëÀ» Çغ¸¸é ±Ý¹æ ¾Ë¼ö ÀÖ½À´Ï´Ù.

sumb¿¡ a[i]¸¦ ´©ÀûÇØ¾ß Çϴµ¥
a[i] += sumb;
ÀÌ·¸°Ô Çϸé a[i] ¿¡  sumb ¸¦ ´©ÀûÇ϶ó´Â °Ì´Ï´Ù.

sumb += a[i]; ÀÌ·¸°Ô ÇØ¾ß ÇÕ´Ï´Ù.
 
 

Total 665
¹øÈ£ Á¦   ¸ñ ±Û¾´ÀÌ ³¯Â¥ Á¶È¸
385 ÀÚ±âÁÖµµ c¾ð¾î ÇÁ·Î±×·¡¹Ö ÇÔ¼ö 2 ÀÚ°¡Áø´Ü 7 (1) °øÅÂÇö 12-03 4163
384 ÀÚ±âÁÖµµ c¾ð¾î ÇÁ·Î±×·¡¹Ö ÇÔ¼ö 2 ÀÚ°¡Áø´Ü 5 (3) °øÅÂÇö 12-02 4174
383 dev-c++ (1) °øÅÂÇö 11-30 7373
382 ÀÚ±âÁÖµµ c¾ð¾î ÇÁ·Î±×·¡¹Ö ÇÔ¼ö 1 Çü¼ºÆò°¡ 5¹ø (1) °øÅÂÇö 11-30 4353
381 ÀÚ±âÁÖµµ c¾ð¾î ÇÁ·Î±×·¡¹Ö ¹è¿­ 2 Çü¼ºÆò°¡ 10 (2) °øÅÂÇö 11-29 4362
380 Àú±â c¾ð¾î°­ÀÇ (1) ±èÀÎÇõ 11-26 3780
379 ÀÚ±âÁÖµµ c¾ð¾î ÇÁ·Î±×·¡¹Ö ¹è¿­ 2 Çü¼ºÆò°¡ 6 (1) °øÅÂÇö 11-21 4313
378 µ¿¿µ»óÀÌ ±úÁö°í Á¤»ó ¼Óµµ·Î Àç»ýÀÌ ¾ÈµË´Ï´Ù. (1) ¿À¼¼¹Ì 11-21 3674
377 ÀÚ±âÁÖµµ c¾ð¾î ÇÁ·Î±×·¡¹Ö ¹è¿­ 2 ÀÚ°¡Áø´Ü 6 (1) °øÅÂÇö 11-19 5406
376 ÁÖ±â ÁÖµµ C¾ð¾î ÄíÆù °áÁ¦ (1) ÇѼºÁø 11-15 4139
375 ÀÚ±âÁÖµµ c¾ð¾î ÇÁ·Î±×·¡¹Ö ¹è¿­ 1 Çü¼ºÆò°¡ 10¹ø (1) °øÅÂÇö 11-12 4044
374 ÀÚ±âÁÖµµ c¾ð¾î ÇÁ·Î±×·¡¹Ö ¹è¿­ 1 Çü¼ºÆò°¡ 9¹ø (3) °øÅÂÇö 11-12 3937
373 2009³â ½Ãµµ¿¹¼± ÃʵîºÎ 9¹ø¹®Á¦ Áú¹®µå¸³´Ï´Ù. (2) Á¤ÀºÁÖ 11-02 4145
372 ÇÔ¼ö1-ÀÚ°¡Áø´Ü 1 (3) °­¼­ÁØ 10-25 3694
371 ¼ö°­·á ÀÔ±Ý Çß½À´Ï´Ù. (1) Á¤ÀºÁÖ 10-21 3567
370 2014³âµµ Áö¿ª¿¹¼± ±âÃâ°­ÀÇ (1) ±ÇÇõÂù 10-12 3756
369 Á¤º¸¿Ã¸²ÇǾƵå Àü±¹,º»¼±,¿¹¼± ¹®Á¦Ç®ÀÌ Àΰ­¿¡ ´ëÇؼ­ Áú¹®µå¡¦ (1) ÀÌÁØÈñ 09-14 5656
368 ÀÚ±âÁÖµµ c¾ð¾î ÇÁ·Î±×·¡¹Ö ¹è¿­ 1 ÀÚ°¡Áø´Ü 8¹ø (1) °øÅÂÇö 09-10 4341
367 ÀÚ±âÁÖµµ c ÇÁ·Î±×·¡¹Ö eºÏ ±¸ÀÔ (1) ÀÌÁ¾»ó 09-02 3969
366 ÀÚ±âÁÖµµ c¾ð¾î Ãâ·Â Çü¼ºÆò°¡ 4¹ø¹®Á¦¿¡¼­ ¾Æ·¡¿Í °°ÀÌ ÀÛ¼ºÇÏ¡¦ (1) ±è¸íÁø 08-20 4674
 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30    

ȸ»ç¼Ò°³ | °³ÀÎÁ¤º¸Ã³¸®¹æħ | ÀÌ¿ë¾à°ü | ã¾Æ¿À½Ã´Â ±æ | À̸ÞÀÏÁÖ¼Ò ¹«´Ü¼öÁý°ÅºÎ | »ç¾÷ÀÚÁ¤º¸È®ÀÎ
°æ±âµµ ¾È¾ç½Ã µ¿¾È±¸ È£°èµ¿ 1065-10 Çù¼º°ñµåÇÁ¶óÀÚ 601È£ ÇÑÄÄ¿¡µàÄÉÀ̼Ç(ÁÖ) TEL : 031-388-8840 FAX : 031-388-0996
´ëÇ¥ÀÚ : ±èµ¿±Ô »ç¾÷ÀÚ¹øÈ£ : 130-86-02870 Åë½ÅÆǸž÷½Å°í¹øÈ£ : Á¦ 2010-°æ±â¾È¾ç-888È£
COPYTIGHT(C) ÇÑÄÄ¿¡µàÄÉÀ̼Ç(ÁÖ), ALL RIGHT RESERVED.
´ãÀº°­Á : 0