Set Operations

This program generates the intersection, union, relative composition, cross product, and power set, of given input (which generates the sets the operations are performed on. ///////////////////////////////////////////////////////////////////////////////// #include <iostream> #include <vector> #include <algorithm> #include <iterator> #include <sstream> //////////////////////////////////////////////////////////////////////////////// std::vector<std::string> createSet(void); // creates set from user input std::vector<std::string> getIntersection(std::vector<std::string> set_A, std::vector<std::string> set_B); …

Modulo Congruence

//////////////////////////////////////////////////////////////////////////////// #include <iostream> #include <math> //////////////////////////////////////////////////////////////////////////////// void numberQuery(unsigned long long &a, unsigned long long &n, unsigned long long &m); unsigned long long powertworesidual(unsigned long long a, unsigned long long n, unsigned long long m); unsigned long long nonpowertworesidual(unsigned long long a, unsigned long long n, unsigned long long m); //////////////////////////////////////////////////////////////////////////////// …

Project Euler #19: Counting Sundays

You are given the following information, but you may prefer to do some research for yourself. 1 Jan 1900 was a Monday. Thirty days has September, April, June and November. All the rest have thirty-one, Saving February alone, Which has twenty-eight, rain or shine. And on leap years, twenty-nine. A …