mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-11-23 21:58:41 +00:00
23 lines
328 B
C
23 lines
328 B
C
|
#include <stdio.h>
|
||
|
|
||
|
int main() {
|
||
|
int n, f,
|
||
|
f_pre2 = 7, f_pre1 = 11;
|
||
|
|
||
|
scanf("%d", &n);
|
||
|
|
||
|
for (int i = 2; i <= n; i++) {
|
||
|
f = (f_pre1 + f_pre2) % 3;
|
||
|
f_pre2 = f_pre1;
|
||
|
f_pre1 = f;
|
||
|
}
|
||
|
|
||
|
if (f == 0) {
|
||
|
printf("YES\n");
|
||
|
} else {
|
||
|
printf("NO\n");
|
||
|
}
|
||
|
|
||
|
return 0;
|
||
|
}
|