Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Björn Bidar
- ITA-E1
- 04.12.2012
- */
- #include <iostream>
- #include <cstdio>
- using namespace std;
- int isLeapyear(int year) {
- if ( year % 4 == 0 && year % 100 != 0 || year % 400 == 0 )
- return 0;
- else
- return 1;
- }
- int getFebDays(int year) {
- int february_days=0;
- if (isLeapyear(year) == 0 )
- february_days=29;
- else
- february_days=28;
- return february_days;
- }
- int main() {
- int year;
- int february_days;
- cout << "Bitte Jahr eingeben:";
- cin >> year;
- cout << endl;
- february_days=getFebDays(year);
- cout << "Der Februar hat im Jahr " << year << " " << february_days << " Tage \n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement