wow
This commit is contained in:
parent
14647b72e2
commit
7f76e58e1e
10 changed files with 150 additions and 5 deletions
21
02/02_56p.c
Normal file
21
02/02_56p.c
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue