TOC666

שאלה 5

Feb 23rd, 2012
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.14 KB | None | 0 0
  1. int ex5(int n,int *sum)
  2. {
  3. if (n==0)
  4. return *sum;
  5. *sum += n;
  6. ex5(n-1,sum);
  7. }
  8.  
  9. int main()
  10. {
  11. int sum=0;
  12. cout<<ex5(4,&sum)<<endl;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment