#include <stdio.h>
int main(){
char last[20];
char first[20];
printf("Please enter your last name:");
scanf("%s",last);
printf("\nPlease enter your first name:");
scanf("%s",first);
printf("Here your email address\n",last,first,@student.com); //last first@student.com
}
Run Code Online (Sandbox Code Playgroud)
我希望用户写下他们的名字,我会自动输出他们的电子邮件.
更改:
printf("Here your email address\n",last,first,@student.com);
Run Code Online (Sandbox Code Playgroud)
至:
printf("Here your email address: %s%s@student.com\n",last,first);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2232 次 |
| 最近记录: |