摘要:
#include<stdio.h>int main(){ long int i,n; long int s1,s2,s; while(scanf("%ld",&n)!=EOF) { s1=0;s2=0;s=0; if(n%2==0) {s1=n/2%2011;s2=(n+1)%2011;}// (a+b)%c与(a%c+b%c)%c相等,乘时也一样, else {s1=(n+1)/2%2011;s2=n%2011;} s=(s1*s2)%2011; printf("%ld\n",s); } return 0;} 阅读全文