問題のコードです

#include <stdio.h>

main( ) {
char buf[256];
int i;

scanf("%d",&i);
rewind(stdin);
fgets(buf,256,stdin);
printf( "%s\n", buf );
}

このコードでfgetsがスルーされてしまいます