正在加载图片...
/ Compute average and print interesting counts. Uses table fill -reads in table entries (same table fill as before table avg cnts -compute average statistics. * Include <stdio. h> i define MAXVALS 100 int main o t int table fill(int a[] int max)i void table avg cnts(int a[l, int n, double avg) double table average(int a[l, int n)i Ln in t七 t [MAXVALS]; table fill(t, MAXVALS) double avg table average(t, n)i printf("There are %i values. \n", n) printf("The average is g.\n", avg)i table avg cnts(t, n, avg)i return 0 PROGRAM MINGMETHDOLODGY AND SOFTWAREENGINEERING 港城市大 Copyrighto1998 Angus Wu ol Hone KonePROGRAMMING METHDOLODGY AND SOFTWARE ENGINEERING Copyright©1998 Angus Wu /* Compute average and print interesting counts. Uses: * table_fill - reads in table entries (same table_fill as before). * table_avg_cnts - compute average statistics. */ #include <stdio.h> #define MAXVALS 100 int main() { int table_fill(int a[], int max); void table_avg_cnts(int a[], int n, double avg); double table_average(int a[], int n); int t[MAXVALS]; int n = table_fill(t, MAXVALS); double avg = table_average(t, n); printf("There are %i values.\n", n); printf("The average is %g.\n", avg); table_avg_cnts(t, n, avg); return 0; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有