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!!!
//Include <HeaderFiles>
usingnamespace 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
}
}
}
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/