| ||||||||||
| 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 | |||||||||
why runtime error? help!!!!!!!!! problem 1942#include <iostream.h>
unsigned k(unsigned, unsigned);
void main() {
unsigned row, col;
while(cin >> row >> col) {
if(!row && !col)
break;
cout << k(row, col) << endl;
}
}
unsigned k(unsigned m, unsigned n) {
unsigned temp, i;
if(m == 1)
temp = n+1;
else if(n == 1)
temp = m+1;
else {
temp = 1 + n;
for(i = 2; i <= m; i++)
temp += k(i, n-1);
}
return temp;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator