일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Daily Commit
- 피보나치 수
- almostIncreasingSequence
- markdown
- shapeArea
- Numpy
- Counting cells in a blob
- 2750
- Sequential Search
- 수 정렬하기
- til
- 파이썬머신러닝완벽가이드
- centuryFromYear
- 10953
- 파이썬 포렌식
- baekjun
- All Longest Strings
- recursion
- matrixElementsSum
- adjacentElementsProduct
- C++
- 2015 봄학기 알고리즘
- cpp
- flask
- codesingal
- codesignal
- Python
- 백준
- data_structure
- collections.deque
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