b3ta.com board
You are not logged in. Login or Signup
Home » Messageboard » XXX » Message 472928 (Thread)

# Just for the hell of it.
// Visual C++ cow humor
// this program gets grass input, and outputs
// the used grass to an intestines file. I was
// going to include a regurgitation function
// in case of over eating, but i got lazy...
 
#include <fstream>
#include <iostream>
#define fullStom = 5; //in pounds.
 
using namespace std;
 
int EatGrass()
int main()
{
    int numOfStoms = 4; // # of stomachs
    int stomCnt = 0; //count stomachs.
 
    ofstream outFile1("intestines.dat"); //declares digestion
   
    for (stomCnt = 0; stomCnt < numOfStoms; stomCnt++) //fill each stomach
       outFile1 << EatGrass(); //eat grass, send to intestines, from each stomach
 
    return 0;
}
 
int EatGrass() //begin grass eating
{
   int grassEaten = 0; //total grass eaten
   int grass; // the grass (duh)
   ifstream inFile1 ("grass.dat"); //declare eating process.
 
   while (grassEaten < fullStom) //until somach is full....
   {
      inFile1 >> grass; //eat grass
      grassEaten += grass; //add grass to total
   }
 
   return grassEaten; //send back to intestines
}
(, Mon 11 Nov 2002, 18:18, archived)