└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # simple cpp codes # code to check is it leap year 2 | #include 3 | using namespace std; 4 | class Solution{ 5 | public: 6 | int isLeap(int N){ 7 | if ((N%4==0 && N%100!=0) || (N%400==0)) 8 | { 9 | return 1; 10 | } 11 | else 12 | { 13 | return 0; 14 | } 15 | } 16 | }; 17 | 18 | int main() 19 | { 20 | int t; 21 | cin>>t; 22 | while(t--) 23 | { 24 | int N; 25 | cin>>N; 26 | Solution ob; 27 | cout << ob.isLeap(N) << endl; 28 | 29 | cout << "~" << "\n"; 30 | } 31 | return 0; 32 | } 33 | --------------------------------------------------------------------------------