1
Name:
General Butt Naked
2012-02-17 19:52
Okay /prog/,
I need some quick help.
http://i.imgur.com/cSAvU.jpg
I got part A done with no problem.
My question is how do I use while and do whiles to store each data set's average and then print it out after a 0 is read.
Here is what I have so far
http://pastebin.com/MuSwgHNv
Thanks
4
Name:
Anonymous
2012-02-17 20:05
You don't need to store data set's averages. Just print them as you finish their calculation.
But, if you insist, just use a list to hold their values.
#include <list>
#include <iostream>
int main() {
std::list<float> v;
float avg;
while (/* exit condition */) {
/* calculate each dataset's avg */
v.push_back(avg);
}
for (std::list<float>::iterator i = v.begin(); i != v.end(); i++) {
std::cout << *i << '\n';
}
}
5
Name:
Anonymous
2012-02-17 20:19
>>4
I see now. I didn't comprehend that last line. I just saw the input and output and assumed that was what need to be printed exactly to the screen.
Sorry, I am an idiot.
7
Name:
Anonymous
2012-02-17 20:57
I'm not clicking your stupid links to read your shitty tasks, if you don't even make the effort to at least post your issues in this thread why would I help you?
8
Name:
Anonymous
2012-02-17 21:01
>>7
The problem was already solved, dude. Don't waste your time.
9
Name:
Anonymous
2013-09-01 19:23
,.‐''"´ ̄`"'' ー ''"´``'ヽ、
;' '⌒ヽ, ,.-、_ `ヽ、_,..,_
,.、,/ '、_ノ__ `Yン'´::::::::`;
ノ,.-'-‐'ー‐'-‐'"´_,,.._`>ー-‐○r'"`)::::::::::i
,'´く.,___,,.. - ''"´:;::::::;:::::::::::_!:::';::ヽ;:::::::;'::::::::::;'
i:::::く/::::::::/:::::_!;/|:::/!:::7´_」_:::!::::::';:::i::::::::::ハ _,,.... -‐- 、.
!::::::;'::::::::::!,'`7_」_レ' ヽ/'´,.-,、`Y:::::!:::';::::::;'::,!. ''"´ `;
';:::::i::i:::::::::!ァ'´,-、 ! ,ハ .ハノ::::::ヽ;:,'´ _,,..,,__,,.. -''´
ヽ;:レ!:::::::;!! i ハ `"´⊂⊃::::::/i''ー:; ''"´
)::`ヽ:ハ `"´ ,..,-‐-、 ∠:;_;;::;:'::| !::::::':,
,':::::::ノ::::⊂⊃ V ノ ,.イ:::ハ:/:::::! ('、::::::! アメリカンドッグくださーい
!/(::::r'i::::|`T.ァー-,-‐ァ'´/レ`/ヽノ、 ヽ、::|
i) ヽ!ヽ/`ヽr''"/´i/ _」/ `ヽ;::ヽ, )'
´ /´`ヾ,ヘ_∞r'7´ `ヽ /`7i::::_」
ri ノ),/ゝ、i ハヾ' !:::::::|
,/ヽ、_ンiイ♀、 ゝr、_ノ ノヽ、,!:::::::!
! ,ハ/ハ \トー‐'' ,ハ_;ノ
'、,__,/ゝーァ´`''ーヽ、.,__,,..イ´ ヽ、
`ア´ / ヽ. `7'ァー、
/ / ,ゝ、 `''ー-/
r''">' ,--., _____ 〈_/'; /
ヽ、., / ̄/ |ー‐i ';/ /
`7ヽ、´..,,__ └‐┘_____,,,... -,t'´、
;'ー-、/  ̄ ̄ ヽ、,_ノノ ハ`、 ,.-‐-、
, '⌒'ヽ、, / `!ー ' i | -=、 )
i'⌒ヽ、 / '、___ノノ ` ー '
─━`''ー--`'━━━━━━━━━━━━━━─