Skip to content

Instantly share code, notes, and snippets.

@jmcph4
Created October 19, 2011 07:57
Show Gist options
  • Select an option

  • Save jmcph4/1297711 to your computer and use it in GitHub Desktop.

Select an option

Save jmcph4/1297711 to your computer and use it in GitHub Desktop.
QIP Set 1 - Bugs (Standard I/O)
#include <cstdio>
#include <iostream>
using namespace std;
int main(void)
{
int input;
cin>>input;
int dividend = 7;
int output = input % dividend;
int nextMultiple;
// If 7 goes into input without remainder
if (output == 0)
{
// Print next multiple
cout<<input + 7;
cout<<"\n";
}
else
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment