countdown!!

Hi...! And happy christmas! I want to make a program that will have for example 3 numbers! 23 43 12! These numbers will be taken from a notepad! And they will do a countdown all together and when it ends the shorter time the program will stop!! The 12 time will first ends! So when it countdown 12 seconds it will be....11 31 0! And at this point i want the program to stop! And i dont now how to do that!!!
hi !!!!
when you say 'from notepad' you mean a text file, right ? !!
get 3 numbers: a, b, c
do{
   print a, b, c
   subtract one from a, b and c
   wait one second
}while(a > 0 && b > 0 && c > 0);

!
Yes i mean a text file!!
But the text file will be like this! Exactly....

1 23
2 45
1 12

! The second numbers are seconds!!!!So i want these numbers to countdown!!!
what is the first one?
anyway, see http://www.cplusplus.com/doc/tutorial/files/
and stop abusing '!'s
the first one is speed of kbs!!
and the second seconds!
!!!!
!
!!!!!
!!!!
!
???
!!!
Is this a homework assignment!!?
I love c++!!! Here's what I would do!!!
(If I understand!!!)

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
//Include <HeaderFiles>
using namespace std;

int main(){

// declare file variable (fstream)
// declare int buffer
// declare any other temp variables

for (int temp = 0; temp < (number of things to go through); temp++){

// input first int (do whatever the hell you want with it)

// input second int to the buffer int
for (int sec = 0; sec < buffer; sec++){

cout << endl; 
if (sec < 10)
cout << "0";

cout << sec;

if (sec != 1)
cout << "'s";

cout << " left!";

// sleep 1 second
}

}


}


Yay!!!!!!
I cant understand how it works
Sorry
There's 77 exclamation points on this page, including the one in this post. O_o

What ultinfinitus gave you there is a hint, rafailos. There's a lot of stuff missing that you'll need to fill in, but he wrote the skeleton for you. You'll have to fill in the std::ifstream-related parts. If you're not sure how to use ifstreams, try this link: http://cplusplus.com/doc/tutorial/files/

Enjoy! :)

-Albatross
Topic archived. No new replies allowed.