zhang2026 @ 2022-05-13 19:50:22
#include<bits/stdc++.h>
using namespace std;
int a,b,c;
int w(int a,int b,int c)
{
if(a<=0||b<=0||c<=0) return 1;
if(a>20||b>20||c>20) return w(20,20,20);
if(a<b||b<c) return w(a,b,c-1)+w(a,b-1,c-1)-w(a,b-1,c);
else return w(a-1,b,c)+w(a-1,b-1,c)+w(a-1,b,c-1)-w(a-1,b-1,c-1);
}
int main()
{
while(1)
{
cin>>a>>b>>c;
if(a==-1&&b==-1&&c==-1) break;
cout<<"w("<<a<<","<<b<<","<<c<<") = "<<w(a,b,c)<<endl;
}
return 0;
}
by irris @ 2022-05-13 20:11:14
被同学抄了四道黑题/xia
by 大眼仔Happy @ 2022-05-13 20:12:58
@AlgorithmerSnow 谁是ta同学?
by irris @ 2022-05-13 20:13:20
@大眼仔Happy 我怎么知道。你看不到他的博客吗。
by zhang2026 @ 2022-05-13 20:13:46
@AlgorithmerSnow 被同学盗号的阿
by zhang2026 @ 2022-05-13 20:14:01
@AlgorithmerSnow 对对对
by 大眼仔Happy @ 2022-05-13 20:14:32
好吧,都散了
by long_live_China @ 2022-05-13 20:16:48
这个人干的641322
by zhang2026 @ 2022-05-13 20:17:01
@Node_Edge 你说有没有一种可能 就是 同一个教室的同学可以用我的帐号 去乱整 @Terrysong
by zhang2026 @ 2022-05-13 20:17:40
@大眼仔Happy 这个@Terrysong
by linxinr @ 2022-05-13 20:19:36
作为博主同学,告诉大家谁干的吧641322