AtCoder Beginner Contest 006

Submission #1768673

Source codeソースコード

#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

Task問題 B - トリボナッチ数列
User nameユーザ名 tomorrow550
Created time投稿日時
Language言語 C (GCC 5.4.1)
Status状態 CE
Score得点 -
Source lengthソースコード長 214 Byte
File nameファイル名
Exec time実行時間 -
Memory usageメモリ使用量 -

Compiler messageコンパイルメッセージ

./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);
^

Test case