You can use scanf, but it will stop scanning when it reaches a whitespace character. This would be a detriment if you have a state or city name with a space (e.g. "Las Vegas"). fgets is the safer form of gets, as it allows you to specify a maximum number of characters to read. So, to answer your question, take a look at the following:
Code:
#include <stdio.h>
#define MAX 50
typedef struct {
char states[MAX];
char cities[MAX];
int tempt;
} Info_t;
int main( void )
{
Info_t info;
fgets( info.states, MAX, stdin );
fgets( info.cities, MAX, stdin );
scanf( "%d", &info.tempt );
return 0;
}
Note the use of a #define preprocessor macro to set the number of characters to be read - this makes it easy to propagate changes throughout your code.
Be aware that fgets will retain a newline character, if present. You may need to make accommodations for this in your code.