English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

the file contain this and is listed like this
f 3.46
m 3.29
f 2.31
m 2.11
m 3.45
f 4.01
f 2.42
f 3.21
m 4.00
m 2.12
f 2.45
m 2.34
f 2.43
m 2.62
f 2.75
m 3.45
m 3.67
f 3.09

2006-12-04 08:32:25 · 1 answers · asked by PJ 2 in Computers & Internet Programming & Design

1 answers

Guess it depends on how you're reading in the data. Basically, each time through, just add the read-in number into a floating point variable if the first character is an 'f'.

your loop
...
if (inChar == 'F')
totalVal += inValue;
...

2006-12-04 08:49:59 · answer #1 · answered by BigRez 6 · 0 0

fedest.com, questions and answers