#include <stdio.h>
int main(){
char a[10];
scanf("%s",&a);
printf("入力されたのは%s",a);
}

これなら問題なく実行できるのですが、
入力される文字数を無制限にできないでしょうか?