Submission #1768673


Source Code Expand

#include<stdio.h>
int main(void) {
int n;
scanf("%d",&n);
int a[n];
a[0] = 0;
a[1] = 0;
a[2] = 1;
for(int i = 3; i < n+1; i++) {
  a[i] = a[i-3]+a[i-2]+a[i-1];
}
printf(a[n]%10007"\n");
return (0);
}

Submission Info

Submission Time
Task B - トリボナッチ数列
User tomorrow550
Language C (GCC 5.4.1)
Score 0
Code Size 214 Byte
Status CE

Compile Error

./Main.c: In function ‘main’:
./Main.c:12:18: error: expected ‘)’ before string constant
 printf(a[n]%10007"\n");
                  ^
./Main.c:12:8: warning: passing argument 1 of ‘printf’ makes pointer from integer without a cast [-Wint-conversion]
 printf(a[n]%10007"\n");
        ^
In file included from /usr/include/stdio.h:937:0,
                 from ./Main.c:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:102:1: note: expected ‘const char * restrict’ but argument is of type ‘int’
 printf (const char *__restrict __fmt, ...)
 ^
./Main.c:12:18: warning: format not a string literal and no format arguments [-Wformat-security]
 printf(a[n]%10007"\n");
                  ^
./Main.c:4:1: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
 scanf("%d",&n);
 ^