| ||||||||||
| 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 | |||||||||
是一个递归,其实和循环100000000次后再输出a+b是一样的In Reply To:谁能解释这个程序为啥可以过A+B? 太NB了~ Posted by:Moon_1st at 2011-05-31 10:47:56 > #include <iostream>
> #include <cstdio>
> using namespace std;
>
> typedef long long llg;
>
> llg a, b;
>
> llg f(llg a, llg b, int depth)
> {
> llg i, j, k, l, v, m, ks;
> if(depth == 100000000) return a+b;
> else return f(a, b, depth+1);
> }
>
> int main()
> {
> while(cin>>a>>b) cout<<f(a, b, 0)<<endl;
> return 0;
> }
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator