#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> main() { int n = 13, i; for (i = 1; i <= 12; i++) { /*n = (n * 3 + n % 100 * 10) % 1000;*/ n = n * 13 % 1000; } printf("%d", n); }