| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
难道不是这样吗?#include<stdio.h>
int f(int n,int m)
{
if(n<=0)return 0;
return (n>=m?m:n)+f(n-2*m,m);
}
int main()
{
int n,m;
scanf("%d%d",&n,&m);
printf("%d\n",f(n,m));
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator