Failed to consume '\n'
scanf("%d",&n); does not consume a trailing '\n'.  That prevents the following scanf("%[^\n]", .... from reading anything.
Allow the scanf("%[^\n]", user_string); to consume leading white-space: scanf(" %[^\n]", user_string);  (space added).
Missing width
scanf("%[^\n]", user_string); is worse than gets.  Do not use "%[^\n]" without a width limit.
// scanf("%[^\n]", user_string);
scanf(" %99[^\n]", user_string);
Missing return value check
Add a check.
if (scanf(" %99[^\n]", user_string) != 1) {
  fprintf(stderr, "Bad input\n");
  exit(EXIT_FAILURE); // or other action.
}
Tip: Read user input with fgets().  Do not use scanf() until you know why it is bad.
Detail: "then I need to read a string with whitespaces" is a faulty goal.  In C, a string is a sequence of characters followed by a null character.  Users do not normally ever enter a null character.
A more correct goal may be "read a line ...".  (Characters up to and including a '\n'.)