Guest User

Untitled

a guest
Nov 22nd, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int year;
  4. int year2;
  5. int i;
  6. int przestepne;
  7. int nieprzestepne;
  8. int second;
  9. void printYear()
  10. {
  11.  
  12.     for (i==year; i==year2; i++)
  13.     {
  14.         if((year%4==0 && year%100!=0) || year%400==0)
  15.             {
  16.             cout<<"Rok "<<year<<" jest przestepny.";
  17.             przestepne++;
  18.             }
  19.         else
  20.             {
  21.             cout<<"Rok "<<year<<"nie jest przestepny.";
  22.             nieprzestepne++;
  23.             }
  24.     }
  25. }
  26.  
  27. void secondInYear();
  28. {
  29. second==(przestepne*366*24*60*60)+(nieprzestepne*365*24*60*60)
  30. }
  31.  
  32.  
  33. int main()
  34. {
  35.     cout << "WITAMY" << endl;
  36.     cout << "Program przelicza lata na sekundy" << endl;
  37.     cout << "Najpierw wpisz rok od ktorego chcesz zaczac liczyc:" << endl;
  38.     cin >> year;
  39.     cout << endl;
  40.     cout << "Teraz wpisz rok, do ktorego zamierzasz liczyc" << endl;
  41.     cin >> year2;
  42.     cout << endl;
  43.     printYear();
  44.     secondInYear();
  45.     system("pause");
  46.     return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment