0
私のタイマーによく似た秒と分のカウンタがあります。しかし、私は画面に留まる時間を得ることができません。あなただけminute
すべての分程度を印刷するのに対し、1秒ごとに端末をクリアしますが、分を残します。
int main()
{
int spam = 0;
int minute = 0;
while (spam != -1)
{
spam++;
std::cout << spam << " seconds" << std::endl;
Sleep(200);
system("CLS");
//I still want the system to clear the seconds
if ((spam % 60) == 0)
{
minute++;
std::cout << minute << " minutes" << std::endl;
}
//but not the minutes
}
}
すべてのクリアスクリーンの後に分を再印刷する必要があります。現在のところ、すべての 'spam%60 == 0'を出力します。 – Tas
それは私が立ち往生しているものです。それをどうやって行うのか知っていますか? –