bubblegum.cpp

28 Jan 2005 @19:45

Here’s last weeks project:


//Name: Andrew Ferguson
//Date: 1/19/2005
//Purpose: To split up bubble gum
#include <conio.h>
#include <iostream>
#include <stdio.h>

using namespace std;

int sticks, people, sticks_person, sticks_remain;

char n;

int main()
{
	cout << "How many sticks of gum do you have?n";
	cin >> sticks;
	cout << "How many people are in MACS 261C?n";
	cin >> people;
	sticks_person = sticks/people;
	sticks_remain = sticks%people;
	cout << "Every person can receive " << sticks_person << ".n";
	cout << "There are " << sticks_remain << " left over.n";

    printf("Press any key to continue...");
    n = getch();

	return 0;
}

Download the compiled executible


Actions

Informations

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Code: To include code, bracket it with [code language="php"] and [/code].
Example: [code language="php"] echo "Hello, World!"; [/code]

Plugin Help: If your requesting help about a plugin, please provide as much information as possible. At the very least, include your WordPress Version and the Plugin Version!