ghost42's Cheat Happens Profile
Cheat Happens Game Cheats and Wallpapers
Cheat Happens Game Cheats and Wallpapers
 
Cheat Happens Game Cheats and Wallpapers
 
     TRAINERS       REQUESTS       GAME REVIEWS       GAME WALLPAPERS       BOARDS
-OR-
  SAVE 25% ON A LIFETIME MEMBERSHIP WITH PROMO CODE "CHULIFEPROMO25" -- SHORT TIME! [ close ] 
 
     
 

ghost42
[email address hidden]

Rank: ELITE  
Member Since: May 05, 2005
Last Visit: Jun 10, 2014
Location: Australia
Message Boards Postcount: 3613
 
view blog comments  
  view all board posts  new private message
add to address book  add to my friends
 
     
   
   LATEST BLOG ENTRY:  SUBSCRIBE TO THIS BLOG (21 subscribers) 
 
  + see more entries 

I Needed To Do Recursion In A Class.
posted 4/2/2014 3:45:55 AM

// They didn't say no nested recursion.
// Here's the source:

#include <iostream>

using namespace std;

void recursion (int a, int b);
void call (int i);
void gap (int i);
void star (int i);

int main()
{

int i = 1;
while (i>0){
cout << "Enter a number: \n";
cin >> i;
if (i > 0)
{
call(i-1);
}
}
return 0;
}

void call (int i)
{
recursion(i* -1, 1);
}

void recursion (int a, int b)
{
gap(a * -1);
star(b);
cout << "\n";
if (a<0)
{
recursion(a+1, b+1);
gap(a * -1);
star(b);
cout << "\n";
}
}

void gap(int i)
{
if(i>0)
{
cout << " ";
gap(i-1);
}
}

void star(int i)
{
if(i>0)
{
cout << " *";
star(i-1);
}
}

 0 comments 

   
   PERSONAL COMMENT:
 
Signers:
Ghost42
darkish_raven
dstates
tmh32293
vonfuzzball
speedemon9
forty-two
Ho-Oh2224
jane29
Chingy42007
racing_nut
yosup
skotch
mr_mango
mkeywood
SirMajinVegeta
jediIStheWAY
mgiab
Bojack
Latiosmaster47
FFQueen92
raha
Quikdeath
mkeywood
SWAT_Marine
king-of-games
The_CheatMaster
Night-Ghost
Whit3Ghost
pokemonlegend
Shinydeoxys
cody587
th3corrupted
Bboy4life
Flamewingman
bes4360
pheephee
NappyHole
Pugsy
RaysoRb
fault2k
planbskater
Deus-Ex-Machina
Spamwise_GameG
N1YTR0
SwingLifeAway
ForestGump1996
Vonny
zachatak95
H.H.H
AmmonJerro
NobleCrusader
Evanscense
the_real_jz
   
     
  4180 users online.
4047 guests / 133 members.
 
   
  Note: Cheat Happens is not responsible for the content of the user's homepage or personal comment. If you find that either contains questionable content, please let us know so we can look into it further. Please send your comments to chris@cheathappens.com.
   
 
Trainer Troubleshooting Guide        Cheat Terms and Tutorials        Anti-Virus Notifications        Site Help / FAQ        Submit Cheats        Our Friends and Affiliates        About Us
      Copyright © 2001 - 2014  webworks, LLC  All Rights Reserved    -   DISCLAIMER    -   PRIVACY POLICY    -   TERMS OF SERVICE