int main(int argc, char** argv)
{
//Local Declaration
char last_name[20];
char first_name[20];
char phone_number[20];
char address[30];
//Statement
printf("Enter your last name: ");
fgets(last_name, 20, stdin);
printf("Enter your first name: ");
fgets(first_name, 20, stdin);
printf("Enter your phone number: ");
fgets(phone_number, 20, stdin);
printf("Enter your address: ");
fgets(address, 30, stdin);
printf("=====Address book=====\n");
printf("Name: %s%s\n", first_name, last_name);
printf("Phone Number: %s\n", phone_number);
printf("Address: %s\n", address);
return (EXIT_SUCCESS);
}
结果并没有像我预期的那样出现......我的意思是名字和姓氏在一行中(例如马克扎克伯格)。但结果是这样的
标记
扎克伯格
这里有什么问题?为什么中间有一条新线?