일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 10953
- 백준
- flask
- centuryFromYear
- All Longest Strings
- recursion
- cpp
- 파이썬 포렌식
- collections.deque
- Daily Commit
- Numpy
- 파이썬머신러닝완벽가이드
- data_structure
- Python
- codesignal
- almostIncreasingSequence
- Counting cells in a blob
- til
- shapeArea
- baekjun
- codesingal
- 수 정렬하기
- matrixElementsSum
- markdown
- 2750
- 피보나치 수
- 2015 봄학기 알고리즘
- Sequential Search
- C++
- adjacentElementsProduct
Archives
- Today
- Total
Introfor
구조체 활용 본문
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | #include <stdio.h> int main(void) { struct date { int year; int month; int day; }; typedef struct date date; struct moive { struct date dt; char *title; char director[20]; int attendance; }; typedef struct moive movie; movie data[] = { {{ 2014,7,30 }, "명량","김한민", 17613000 }, { { 2014,12,17 }, "도둑들","최동훈", 12983000 }, { { 2014,12,17 }, "국제시장","류승완", 14257000 }, }; printf(" 제목 감독 관객수 개봉일\n"); printf("=================================================\n"); for (int i = 0; i < 3; i++) printf(" [%8s] %6s %d %d.%d.%d\n", data[i].title, data[i].director, data[i].attendance, data[i].dt.year, data[i].dt.month, data[i].dt.day); return 0; } | cs |
'Doing > C&C++' 카테고리의 다른 글
팩토리얼(반복, 재귀) (0) | 2017.09.05 |
---|---|
구조체 활용 (0) | 2017.05.25 |
디지털 숫자 출력 (0) | 2017.05.01 |
제한된 크기 만큼 입력받은 값과 그 길이 출력 (0) | 2017.04.05 |
2진수, 8진수, 16진수 출력 및 비트 연산 출력 (0) | 2017.04.05 |
Comments