有谁知道我怎样才能让这个循环运行 60 秒然后停止?这是我的代码:
#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
int a=1;
int b;
cout<<"3.";
b=a*10%7;
while(b!=0)
{
cout<<a/7;
a=b*10;
b=a%7;
}
getch();
return 0;
}
原文由 Mr.Matho 发布,翻译遵循 CC BY-SA 4.0 许可协议
使用
<chrono>
库。