1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
void countNumbers( int &count0, int &count1, int &count2, int &count3,
int &count4, int &count5, int &count6, int &count7,
int &count8, int &count9, ifstream &fin, int size )
{
int test, arr[ size ], current, count = 0;
fin.ignore( 100, '.' );
fin >> current;
while( !fin.eof() )
{
arr[ count ] = current;
fin >> current;
count++;
}
while( count < size )
{
arr[ count ] = test;
if( test == 0 )
{
count0++;
}
if( test == 1 )
{
count1++;
}
if( test == 2 )
{
count2++;
}
if( test == 3 )
{
count3++;
}
if( test == 4 )
{
count4++;
}
if( test == 5 )
{
count5++;
}
if( test == 6 )
{
count6++;
}
if( test == 7 )
{
count7++;
}
if( test == 8 )
{
count8++;
}
if( test == 9 )
{
count9++;
}
count++;
}
}
|