Skip to content

Instantly share code, notes, and snippets.

View alabombarda's full-sized avatar

Andrew LaBombarda alabombarda

  • Austin, TX
View GitHub Profile
@alabombarda
alabombarda / adjacentDigitsProduct
Created June 2, 2015 15:57
Part 2 of the rmotr.com python scholarship. C++ program that takes a large number formatted as a string and finds the biggest product of n adjacent digits within the string.
#include <iostream>
#include <string>
#include <vector>
unsigned long long int adjDigProduct(std::vector<int> NUMB, int digits, unsigned long long int biggest);
std::vector<int> vectorify(std::string s);
int main()
{
//initialize variables
@alabombarda
alabombarda / findNextPrime
Created May 28, 2015 19:02
A simple program in C++ that finds the next prime number above a given number.
#include <iostream>
int findNextPrime(int n); //given a number n, find the next closest prime number above n
bool isPrime(int n); //given a number n, determine if it is prime
int main()
{
int input;
std::cout << "Please enter a prime number: ";