一.抄
二.做
1.输入名字将名和姓输出顺序改变
#include <stdio.h>
int main()
{
char firstname[20],lastname[20];
printf("Please enter your firstname.");
scanf("%19s",firstname);
printf("Please enter you lastname.");
scanf("%19s,",lastname);
printf("Hello!%s,%s.\n",lastname,firstname);
return 0;
}
2.
#include <stdio.h>
#include <string.h>
int main()
{
int len=0;
char name[20];
printf("Write yor name.\n");
scanf("%19s",name);
len=strlen(name);
printf("Print your name:\n");
printf("a.\"%s\"\n", name);
printf("b.\"%20s\"\n", name);
printf("c.\"%-20s\"\n", name);
printf("d.%*s\n", len + 3, name);
return 0;
}