Gimana ya klo buat Kalender dengan C++?? bsa Gak Y? Pasti bisa dooonggg....
Screen Shootnya kaya Gini nie:
nah ini scriptnya C++ nya:
#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
Minggu, 20 Desember 2009
//
Label:
Calender dengan C++
//
3
komentar
//
3 komentar to "Membuat Calender dengan C++"
Hend►a says:
kasih comment ya...
Anonim says:
Ngapain repot-repot ada kalender kok dirumah
hari gini kok repot, hahahaa . .
dreamhunter
Anonim says:
aku pakek dev c++ 4.9.9.2 kok ga bisa di cmpile ya??