/*
** プログラム名: kadai20
** 動作: 自己紹介パート2
** 作者: 自分の名前、学籍番号
** 日付: 今日の日付
*/
#include <stdio.h>
#include <string.h>
int main(void)
{
char first[10]; /* 苗字を入れる配列変数 */
char last[10]; /* 名前を入れる変数 */
char full[20]; /* フルネームを入れる変数 */
strcpy(first, "firstname"); /* あなたの苗字を入れてください */
strcpy(last, "lastname"); /* あなたの名前を入れてください */
strcpy(full, first);
strcat(full, ' '); /* 苗字と名前の間に空白をあける */
strcat(full, last);
printf("My name is %s.\n", full);
return 0;
}
|