Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- int rok = 0;
- bool correct = 0;
- while(!correct)
- {
- cout << "Podaj rok: ";
- cin >> rok;
- if(rok <= 0){
- cout<<"Podany rok nie moze byc liczba ujemna \n";
- correct = false;
- }
- else{
- correct = true;}
- };
- if((fmod((float)rok,4) == 0) && (fmod((float)rok,100) != 0) && (fmod((float)rok,400) == 0))
- {
- cout << "Ten rok jest przestepny!";
- }
- else
- {
- cout << "Ten rok nie jest przestepny!";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement