Answer the question
In order to leave comments, you need to log in
How to combine different blocks of code in one place?
I'm starting to learn C++. I don't understand how to combine different lines of code output text and countdown after?
After outputting this code
#include "stdafx.h"
#include <iostream>
#include <cstdlib> // для system
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
setlocale(LC_ALL, "Russian");
cout << "Форматирование жёсткого диска HDD запущено" << endl;
system("pause"); // Только для тех, у кого MS Visual Studio
return 0;
}
for (int i = 60; i > 0; i--)
{
cout << i << endl;
Sleep(1000);
}
Answer the question
In order to leave comments, you need to log in
cout << "Осталось " << i << " секунд..." << endl; //перед sleep
cout << "Форматирование жёсткого диска HDD завершено" << endl
#include "stdafx.h"
#include <iostream>
#include <cstdlib> // для system
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
setlocale(LC_ALL, "Russian");
cout << "Форматирование жёсткого диска HDD запущено" << endl;
for (int i = 60; i > 0; i--)
{
cout << i << endl;
Sleep(1000);
}
// system("pause"); // Только для тех, у кого MS Visual Studio
return 0;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question