Quantcast
Channel: CSDN博客推荐文章
Viewing all articles
Browse latest Browse all 35570

POJ1664(放苹果,感觉比较有意思)

$
0
0
#include<iostream>
#include <cstdio>
#include <cstring>
using namespace std;

int counter(int x,int y) {
    if(y==1 || x==0) { return 1; }
    if(x<y) return  counter(x, x);
    return  counter(x,y-1) + counter(x-y,y);
}

int main()
{
    int t, m, n;
    cin>>t;
    for(int i=0; i<t; i++) {
        cin >> m >> n;
        cout << counter(m,n) << endl;
    }
    return 0;
}

作者:wangwenhao00 发表于2013-2-18 23:32:12 原文链接
阅读:82 评论:0 查看评论

Viewing all articles
Browse latest Browse all 35570

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>