¹è¿2 ÀÚ°¡Áø´Ü6
/* 5¸í ÇлýÀÇ ±¹¾î ¿µ¾î ¼öÇÐ °úÇÐ 4°ú¸ñÀÇ Á¡¼ö¸¦ ÀÔ·Â ¹Þ¾Æ¼ °¢ °³Àκ°·Î Æò±ÕÀÌ 80 ÀÌ»óÀ̸顰ÇÕ°Ý¡±
±×·¸Áö ¾ÊÀ¸¸é¡°ºÒÇÕ°Ý¡±À» Ãâ·ÂÇÏ°í ÇÕ°ÝÇÑ »ç¶÷ÀÇ ¼ö¸¦ Ãâ·ÂÇÏ´Â ÇÁ·Î±×·¥À» ÀÛ¼ºÇϽÿÀ.
85 67 95 65
80 95 86 56
100 98 67 86
95 76 84 65
67 86 90 76
ºÒÇÕ°Ý
ºÒÇÕ°Ý
ÇÕ°Ý
ÇÕ°Ý
ºÒÇÕ°Ý
ÇÕ°ÝÀÚ 2¸í*/
#include<stdio.h>
int main()
{
int num=0, sum=0; double avg[5]; int arr[5][4], i, j;
for (i=0; i<5; i++) {
for (j=0; j<4; j++) {
scanf("%d", &arr[i][j]);
sum+=arr[i][j];
}
avg[i]=sum/4.0;
}
for (i=0; i<5; i++) {
if (avg[i]>=80) {
printf("ÇÕ°Ý\n");
num+=1;
}
else printf("ºÒÇÕ°Ý\n");
}
printf("ÇÕ°ÝÀÚ %d¸í", num);
}
ÀÌ ÄÚµåÀÇ °á°ú´Â ÀÌ·¯ÇÕ´Ï´Ù,
/d4.out=================
input:
70 84 85 89 -> °è»ê±â·Î Æò±ÕÀ» ³»¸é 82
81 90 88 71
93 45 35 3
94 96 99 98
84 93 85 93
-----------------
Cpu:
ºÒÇÕ°Ý -> ?????????
ÇÕ°Ý
-----------------
Your:
ÇÕ°Ý
ÇÕ°Ý
=================
½Ã½ºÅÛ¿¡ ¹®Á¦°¡ ÀÖ´Â °Í °°½À´Ï´Ù.