2019省赛A组第2题

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int first=1,second=1,third=1;
    for(int i=4;i<=20190324;i++){
        int temp=(first+second+third)%10000;
        first=second;
        second=third;
        third=temp;
    }
    cout<<third;
    return 0;
}

这道题这个求余挺好的。

posted @ 2021-04-12 17:34  南理工学渣  阅读(18)  评论(0)    收藏  举报