Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int year;
- int year2;
- int i;
- int przestepne;
- int nieprzestepne;
- int second;
- void printYear()
- {
- for (i==year; i==year2; i++)
- {
- if((year%4==0 && year%100!=0) || year%400==0)
- {
- cout<<"Rok "<<year<<" jest przestepny.";
- przestepne++;
- }
- else
- {
- cout<<"Rok "<<year<<"nie jest przestepny.";
- nieprzestepne++;
- }
- }
- }
- void secondInYear();
- {
- second==(przestepne*366*24*60*60)+(nieprzestepne*365*24*60*60)
- }
- int main()
- {
- cout << "WITAMY" << endl;
- cout << "Program przelicza lata na sekundy" << endl;
- cout << "Najpierw wpisz rok od ktorego chcesz zaczac liczyc:" << endl;
- cin >> year;
- cout << endl;
- cout << "Teraz wpisz rok, do ktorego zamierzasz liczyc" << endl;
- cin >> year2;
- cout << endl;
- printYear();
- secondInYear();
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment