@greeezz
274 / 167 / 4
Регистрация: 10.07.2011
Сообщений: 441
|
14.10.2011, 05:07
|
|
У меня так получилось.
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
| #include "stdafx.h"
#include <conio.h>
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int plusOneRecursive(int *first, int *second){
if(*second == 0){
return *first;
} else {
*first += 1;
*second -= 1;
return plusOneRecursive(first,second);
}
}
int main(){
int first;
int second;
cout << "Enter first number : ";
cin >> first;
cout << "Enter second number : ";
cin >> second;
cout << "RESULT :: " << plusOneRecursive(&first, &second);
_getch();
return 0;
} |
|
0
|