Public feed #886948

Miscellany

public cpp v1 · immutable
Raw Edit
·published 2008-02-01 01:23 UTC
rendered paste body
#include <iostream.h>#include <conio.h>int main (){int numberofsnatches;int numberofextrasnatches;int counter=0;float tempnumber;float totalnumber;float snatchcounter;cout << "enter number of snatches before you: ";cin >> numberofsnatches;snatchcounter = numberofsnatches + 1;do{	tempnumber = (1 / snatchcounter);	snatchcounter = snatchcounter + 1;	totalnumber = totalnumber + tempnumber;	counter = counter + 1;}while (totalnumber < 1);cout << "Snatch number: " << (counter + numberofsnatches) << " will make your ratio be: " << totalnumber << endl;cout << "You will need " << counter << " extra people, or " << (counter + numberofsnatches) << " total snatches." << endl;  getch();return 0;}