zarb 2 adadبه زبان c++
سمیرا نوری | پنجشنبه, ۱۹ شهریور ۱۳۹۴، ۰۹:۴۶ ب.ظ
#include<iostream>
#include<conio.h>
using namespace std;
int mystery(int a ,int b)
{
if(b==1)
return a;
else
return a+mystery (a ,b-1);
}
void main()
{
int x,y;
cin>>x>>y;
cout<< mystery(x,y);
getch();
}
- ۰ نظر
- ۱۹ شهریور ۹۴ ، ۲۱:۴۶