mirror of
https://github.com/RustyRaptor/isOddOrEven-collection.git
synced 2026-12-04 02:55:15 -07:00
81 lines
2.3 KiB
C++
81 lines
2.3 KiB
C++
#include <iostream>
|
|
|
|
// runs in O(n!) lole
|
|
#define ____________________________ ;
|
|
#define ___________________________ long long
|
|
#define __________________________ int
|
|
#define _________________________ typedef
|
|
|
|
#define ________________________ enum
|
|
|
|
#define ____________________ N
|
|
#define __________________ std::cout<<"even\n"
|
|
#define _________________ std::cout<<"odd\n"
|
|
#define ________________ 0
|
|
#define _______________ 1
|
|
#define ______________ false
|
|
#define _____________ a
|
|
#define __________ main(void)
|
|
#define _________ return
|
|
#define ________ {
|
|
#define _______ }
|
|
#define ______ =
|
|
#define _____ !
|
|
#define ____ <
|
|
#define ___ >
|
|
#define __ struct
|
|
#define _ template
|
|
|
|
|
|
#define ___________________ (((____________________) ____ (________________)) ? ((____________________) + (_______________)) : ((____________________) - (_______________)))
|
|
|
|
#define isOddOrEven(_____________)((_______________________ ____ _____________ ___ :: ______________________) ? (_________________) : (__________________))
|
|
|
|
_________________________ ___________________________ ____________ ____________________________
|
|
_________________________ __________________________ ___________ ____________________________
|
|
|
|
_ ____ ____________ ____________________ ___
|
|
__ _______________________ ________
|
|
________________________ ________ ______________________ ______ _____ _______________________ ____ ___________________ ___ :: ______________________ _______ ____________________________
|
|
_______ ____________________________
|
|
|
|
_ ____ ___
|
|
__ _______________________ ____ ________________ ___ ________
|
|
________________________ ________ ______________________ ______ ______________ _______ ____________________________
|
|
_______ ____________________________
|
|
|
|
___________ __________ ________
|
|
|
|
isOddOrEven(124) ____________________________
|
|
isOddOrEven(23) ____________________________
|
|
isOddOrEven(-1) ____________________________
|
|
isOddOrEven(-256) ____________________________
|
|
|
|
_________ ________________ ____________________________
|
|
_______
|
|
|
|
|
|
/* Readable version for the weak
|
|
|
|
#define NEXT ((N) < (0)) ? ((N) + (1)) : ((N) - (1))
|
|
|
|
typedef long long ll;
|
|
|
|
template < ll N >
|
|
struct Parity {
|
|
enum { isOdd = !Parity< NEXT > };
|
|
};
|
|
|
|
template <>
|
|
struct Parity < 0 > {
|
|
enum { isOdd = false };
|
|
};
|
|
|
|
int main(void) {
|
|
|
|
( Parity< -123 >::isOdd ) ? std::cout << "odd\n" : std::cout << "even\n";
|
|
|
|
return 0;
|
|
}
|
|
|
|
*/ |