fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int x = 2014, y;
  6. for (y = 2014; y > 1; y /= 2) {
  7. x = x * x % 10000;
  8. if (y % 2) x = x * 2014 % 10000;
  9. }
  10. printf("%04d\n", x);
  11.  
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
5184