1 /* 2 *PAT IO-02 整数四则运算 3 *2015.7.30 4 *作者:flx413 5 */ 6 7 #include<stdio.h> 8 int main() 9 { 10 int a[4], sum; 11 float average; 12 scanf("%d%d%d%d", &a[0], &a[1], &a[2], &a[3]); 13 sum = a[0] + a[1] + a[2] + a[3]; 14 average = sum / 4.0; 15 printf("Sum = %d; Average = %.1f", sum, average); 16 return 0; 17 }
时间: 2024-11-05 21:42:18