Sleep funktionirt nicht
Code:
#include <iostream>
#include <string>
#include <ctime>
using namespace std;
int main()
{
int t;
string name;
cout << "Ingiv dit navn: ";
cin >> name;
cout << "Goddag " << name << endl << endl;
cout << "Du har lige soerget for at din Computer bliver oedelagt" << endl;
for(int t = 8; t <= 0; t--);
{
cout << "Din computer er slukket om: \a" << t << "Sekunder" << endl << endl << endl;
Sleep(1000);
}
if(t== 0)
{
system("%systemroot%\System32\Shutdown.exe -s -f -t 0");
}
else
{
cout << "Der opstaoet en fejl \a \n";
return 0;
}
}