Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int rok;
- int a; // rok%19;
- int b; // rok%4;
- int c; // rok%7;
- int d; // (19*a+A)%19;
- int e; // (2*b+4*c+6*d+B)%7;
- int A;
- int B;
- int wielkanoc;
- cout << "Podaj rok: ";
- cin >> rok;
- if(rok>=1800 && rok<=1899){
- A = 23;
- B = 4;
- }
- if(rok>=1900 && rok<=2099){
- A = 24;
- B = 5;
- }
- if(rok>=2100 && rok<=2199){
- A = 24;
- B = 6;
- }
- a = rok%19;
- b = rok%4;
- c = rok%7;
- d = (19*a+A)%30;
- e = (2*b+4*c+6*d+B)%7;
- wielkanoc = 22+d+e;
- if(wielkanoc<31){
- cout << "Wielkanoc wypada " << wielkanoc << " marca";
- }else{
- cout << "Wielkanoc wypada " << (wielkanoc-31) << " kwietnia";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement