Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void)
- {
- int score[5];
- int i;
- int tot = 0;
- double avg;
- for(i=0;i<5;i++){scanf("%d",&score[i]);}
- for(i=0;i<5;i++){tot+=score[i];}
- avg = tot / 5.0;
- for(i=0;i<5;i++){printf("%5d",score[i]);}
- printf("\n");
- printf("평균 : %.1f\n",avg);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement