HELP w/ loops

Need help to slow down this loop...

#include <iostream>
#include <string>
using namespace std;

int main()
{
int input;

cout << "How many missiles will you fire?" << endl;
cin >> input;
cout << endl;

for (int i = 0; i < input; i++) {
for (int j = 10; j > 0; j--) {
cout << j << " ";
}
cout << "Missile " << i+1 << " has launched." << endl;
}

cout << "All missiles have been launched." << endl;
return 0;
}
//if it is compiled, it goes much to fast.
for(int j=10;j>0;j--)
{
cout<<j<<" ";
Sleep(100);//milliseconds to sleep
}

also use #include <windows.h>


Topic archived. No new replies allowed.