21 lines
No EOL
492 B
C
21 lines
No EOL
492 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
int main() {
|
|
char name[100];
|
|
char school[100];
|
|
char department[100];
|
|
|
|
printf("이름 : ");
|
|
scanf("%s", name);
|
|
getchar(); // consume newline
|
|
printf("학교 : ");
|
|
fgets(school, sizeof(school), stdin);
|
|
school[strcspn(school, "\n")] = '\0'; // remove newline from school
|
|
printf("학과 : ");
|
|
scanf("%s", department);
|
|
|
|
printf("%s\n%s\n%s님 안녕하세요?\n", school, department, name);
|
|
|
|
return 0;
|
|
} |