Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language programming histogram
C language programming histogram
# Contains? & ltstdio.h & gt

Invalid? DrawHistogram(int? nArray[],? int? nCount,? Charles? ch)? {

int? Me, j, m? =? 0;

For (me? =? 0; ? Me? & lt? nCount? ++i)? {

For (j? =? 0; ? j? & lt? nArray[I]; ? ++j)

printf("%c ",ch);

printf("%d\n ",nArray[I]);

}

printf(" \ n ");

}

Invalid? CountRangeItems(double? dArray[],? int? nDataItems? int? nArray[])? {

int? Me;

For (me? =? 0; ? Me? & lt? nDataItems? ++i)? {

if(dArray[i]? & lt=? 160)? ++ nArray[0];

Or what? if(dArray[i]? & lt? 165)? ++ nArray[ 1];

Or what? if(dArray[i]? & lt? 170)? ++ nArray[2];

Or what? if(dArray[i]? & lt? 175)? ++ nArray[3];

Or what? if(dArray[i]? & gt? 175)? ++ nArray[4];

}

}

int? main()? {

Double? Height []? =? { 185, 176, 165, 169, 160, 152, 187, 196, 178, 189, 196, 182, 18 1, 176, 159, 163, 168};

int? nArray[5]? =? {0};

int? nCount? =? 0, size? =? sizeof(height)/sizeof(height[0]);

CountRangeItems (height, size, narrow);

DrawHistogram(nArray,5,' * ');

Return? 0;

}