Source:
[source lang ="cpp"]#include<iostream>using namespace std;int greencrud(int crud_days, int amount_crud){ int crud_fib = 0; int numberof_crud = amount_crud; int i; int t; for( i = crud_days / 5; i <= crud_days; i++) { t = crud_fib + numberof_crud; crud_fib = numberof_crud; numberof_crud = t; } return numberof_crud;}int main() { int numberofcrud2 = 0; cout << "Welcome to Crud Estimator\n"; cout << "Please enter the number of days the crud has been grown \n"; int crud_days = 0; cin >> crud_days; cout << "Please enter the original amount of crud "; int amount_crud; cin >> amount_crud; cout << "\nThe number of crud you have in your household is " << greencrud(crud_days, amount_crud); return 0;}
[Edited by - Blckknight118 on October 19, 2010 3:45:47 PM]