http://acm.pku.edu.cn/JudgeOnline/problem?id=1664
還是沒理解爲什麼這麼做
#include<stdio.h> int dg(int m, int n) { if(m < 0) return 0; if(m == 0 || n == 1) return 1; return dg(m-n, n) + dg(m, n-1); } int main() { int t, m, n; while(scanf("%d", &t) != EOF) { while(t--) { scanf("%d%d", &m, &n); printf("%d/n", dg(m, n)); } } return 0; }
代碼: #include <stdio.h> #include <string.h> char str1[100]; char str2[100]; int main() {int n;int i,j,count,num,flag;whi
代碼如下: #include <stdio.h> #include<math.h> #include <string.h> int gcd(int a,int b); int main() { int N,i,j,count; i
代碼: #include <stdio.h> int main() {long A,L,num=1,a;int j=1;while(scanf("%ld%ld",&A,&L)==2&&A>0&&L>0){num=1; a=A;w
南陽OJ-No.34 時間限制3000ms,內存限制65535KB,難度2 描述 給定兩個數m,n,其中m是一個素數。 將n(0<=n<=10000)的階乘分解質因數,求其中有多少個m。 輸入 第一行是一個整數s(0 < s <
Excuses, Excuses! Judge Ito is having a problem with people subpoenaed for jury duty giving rather lame excuses
Where's Waldorf? Given a m by n grid of letters, ( ), and a list of words, find the location in the grid at wh
Problem I Automatic Poetry Input: standard input Output: standard output Time Limit: 2 seconds Memory Limit: 32 MB
Basic 輸入A、B,輸出A+B。 數據規模 -10000 <= A, B <= 10000。 #include<iostream> using namespace std; int main() { int num1,num
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right;
簡單枚舉類型——植物與顏色 Time Limit: 1000MS Memory Limit: 65536KB Problem Description 請定義具有red, orange, yellow, green,
數據結構實驗之鏈表一:順序建立鏈表 Time Limit: 1000MS Memory Limit: 65536KB Problem Description 輸入N個整數,按照輸入的順序建立單鏈表存儲,並遍歷所建立
三國佚事——巴蜀之危 Time Limit: 1000MS Memory Limit: 65536KB Problem Description 話說天下大勢,分久必合,合久必分。。。卻道那魏蜀吳三國鼎力之時,多少英雄豪傑
數據結構實驗之鏈表四:有序鏈表的歸併 Time Limit: 1000MS Memory Limit: 65536KB Problem Description 分別輸入兩個有序的整數序列(分別包含M和N個數據),建立兩
王小二切餅 Time Limit: 1000MS Memory Limit: 65536KB Problem Description 王小二自誇刀工不錯,有人放一張大的煎餅在砧板上,問他:“餅不許離開砧板,切n(1<=
折線分割平面 Time Limit: 1000MS Memory Limit: 32768KB Problem Description 我們看到過很多直線分割平面的題目,今天的這個題目稍微有些變化,我們要求的是n條折線