/*
提示输入姓,名,然后在一行打印,在第二行显示如下格式
Melissa Honeybee
7 8
接下来显示如下格式
Melissa Honeybee
7 8
*/
#include <stdio.h>
#include <string.h>
int main(void)
{
char first_name[20];
char last_name[20];
int first_width;
int last_width;
printf("Please input your first_name:");
scanf("%s", first_name);
printf("Please input your last_name:");
scanf("%s", last_name);
first_width = strlen(first_name);
last_width = strlen(last_name);
printf("%s %s\n", first_name, last_name);
printf("%*d %*d\n", first_width, first_width, last_width, last_width);
printf("%-*d %-*d\n", first_width, first_width, last_width, last_width);
return 0;