Problem:送分题
Description:
伟大的ACMer史努比说过天才第一步,XX纸尿裤;
读下面程序,提交正确的代码,或者选择正确的语言将以下程序直接提交。
#include<stdio.h>
long long f(long long n)
{
if (n < 20180001) return n + 2017;
return f(f(n - 2018));
}
int main()
{
int T;scanf("%d",&T);
while(T--){
long long n;
scanf("%lld",&n);
printf("%lld\n",f(n));
}
return 0;
}
Input:
输入T组,每组一个整数n.(1<=n<=1e18)
Output:
输出一个整数表示答案
Sample Input:
4
20182017
20182012
20182019
1
Sample Output;
20182017
20182017
20182017
2018
Language:C++
#include<iostream>
using namespace std;
int main()
{
int T;
cin>>T;
while(T--)
{
long long n;
cin>>n;
if (n<20180001) cout<<n+2017<<endl;
else cout<<20182017<<endl;
}
return 0;
}