C언어 달력만들기
- 최초 등록일
- 2013.01.31
- 최종 저작일
- 2012.04
- 7페이지/ 한컴오피스
- 가격 1,500원
소개글
C언어를 이용하여 달력만들기 예제
목차
1. 소스
① 빌드 화면
② 디버깅 화면
③ 연도, 월 입력 화면
④ 최종 달력 출력 화면
본문내용
int total_dates(int year, int month, int* monthday);
void printfMonth(int year,int month, int week, int* monthday );
int calcweek(int week);
int main(void)
{
int year, month, week_day;
int t_dates;
char *week[] = {"일", "월", "화", "수", "목", "금", "토"};
int month_day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
do
{
printf ("출력할 년도와 월을 입력하세요 (형식 : 2010 09 ) ? : ");
scanf ("%d%d", &year, &month );
if( 0< month && month < 13)
break;
else
printf("입력오류 다시입력하세요 \n");
}while(1);
t_dates = total_dates(year, month, month_day);
week_day = calcweek(t_dates);
printfMonth(year,month,week_day,month_day);
return 0;
참고 자료
없음