Membuat Calender dengan C++

Gimana ya klo buat Kalender dengan C++?? bsa Gak Y? Pasti bisa dooonggg....


Screen Shootnya kaya Gini nie:
nah ini scriptnya C++ nya:

NB: oh ya, jngn lpa yang tanda kurungnya diganti jadi tanda kurung siku "<>" hanya pada perintah awalnya saja yg "#include(cstdlib), #include(iostream), #include(stdio.h), #include(time.h)".

#include (cstdlib)
#include (iostream)
#include (stdio.h)
#include (time.h)


using namespace std;

int IsLeapYear(const int year) {
return ((year%400==0) || (year%4==0 && year%100!=0));
}


int GetDaysInMonth (const int year, const int month) {
switch (month) {
case 2: return IsLeapYear(year) ? 29 : 28;
case 4:
case 6:
case 9:
case 11: return 30;
default: return 31;
}
}


int FirstDayOfMonth(const int year, const int month) {
// 0 = Sunday
static int t[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
int y = year - (month < days =" GetDaysInMonth(year," dow =" FirstDayOfMonth(year," day="0;" day="1;"><=days; day++) { printf("%3d ", day); if (++dow>6) { dow = 0; printf("\n "); }
}
printf("\n");
}



int main(int argc, char *argv[])
{


// test on today
time_t curtime = time(NULL);
struct tm *loctime = localtime(&curtime);
ShowCal((loctime->tm_year + 1900), (loctime->tm_mon + 1));



system("PAUSE");
return EXIT_SUCCESS;
}





sourceFrom: jakerpomperada@yahoo.com


3 komentar to "Membuat Calender dengan C++"

Posting Komentar