XJOI 3709 测测你的RP

题意

总共10个测试点
在第i个测试点输入i-1

分析

time()函数是指返回自 Unix 纪元(January 1 1970 00:00:00 GMT)起的当前时间的秒数的函数,主要用来获取当前的系统时间。一般是time(0)
使用循环,当时间到达下一秒时,输出答案即可。

Code

#include<cstdio>
#include<ctime>
using namespace std;
int main(){
    int T=/*某一时刻的time(0)*/,t=time(0);
    while(time(0)==t);
    printf("%d",time(0)-T);
    return 0;
}

猜你喜欢

转载自www.cnblogs.com/BlogOfchc1234567890/p/9876517.html
今日推荐