Practice #2
Coddy의 C/C++ 구조체 코스 레슨 — 8개 중 7번째.
챌린지
쉬움일부 코드가 주어집니다. 나머지 코드와 일치하도록 Contact 구조체를 생성하세요.
직접 해보기
#include <stdio.h>
// 여기에 구조체를 생성하세요
int main() {
struct Contact contact1 = {"John Doe", "123-456-7890", "john@example.com"};
struct Contact contact2 = {"Alice Smith", "456-789-0123", "alice@example.com"};
struct Contact contact3 = {"Bob Johnson", "789-012-3456", "bob@example.com"};
printf("%s %s %s\n", contact1.name, contact1.phoneNumber, contact1.email);
printf("%s %s %s\n", contact2.name, contact2.phoneNumber, contact2.email);
printf("%s %s %s\n", contact3.name, contact3.phoneNumber, contact3.email);
return 0;
}