>>3

とりあえずscanf()でいいんじゃない?

int a;

printf( "how many rows?\n" );
scanf( "%d", &a);

みたいな感じで使う。これでaにユーザーが入力した値が入るよ。