#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
int main() {
cout<<"欢迎进入计时软件!!!"<<endl;
Sleep(300);
int x=0;
while(x<=0){
cout<<"1正计时,2倒计时:"<<endl;
int a;
cin>>a;
if(a==1){
cout<<"最多几秒:"<<endl;
int f;
cin>>f;
double b;
for(b=0;b<=f;b=b+0.1){
Sleep(100);
system("cls");
cout<<b<<"秒"<<endl;
if(b==f){
cout<<"时间到!!!"<<endl;
}
}
}
if(a==2){
cout<<"多少:"<<endl;
double d,e;
cin>>d;
for(e=d;e>0;e=e-0.1){
Sleep(100);
system("cls");
cout<<e<<"秒"<<endl;
if(e==1){
cout<<"时间到!!!"<<endl;
}
}
}
}
return 0;
}
又是计时器!!!
于 2025-03-16 16:13:30 首次发布