CF 260 B. Fedya and Maths

链接
提示:找规律

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
const int maxn=1e5+5;
char s[maxn];
int main()
{
   cin>>s;
   int len=strlen(s);
   int sum=(s[len-2]-'0')*10+(s[len-1]-'0');
   if(sum % 4 == 0)
     puts("4");
   else
     puts("0");
   return 0;
}

你可能感兴趣的:(CF 260 B. Fedya and Maths)