@[TheIceStar](/user/764616) 少了个else
by Cstdio_Rabbit @ 2022-08-06 21:33:41
```c++
#include <iostream>
using namespace std;
long long memory[25][25][25];
long long clac(long long a, long long b, long long c);
int main(){
long long a = 0;
long long b = 0;
long long c = 0;
cin>>a>>b>>c;
while (a != -1 && b!=-1 && c!=-1){
cout << "w" << "(" << a << ", " << b << ", " << c << ") = " << clac(a, b, c) << endl;
// cout << a << b << c;
cin>>a>>b>>c;
}
return 0;
}
long long clac(long long a, long long b, long long c){
if (a <= 0 || b <= 0 || c <= 0){
return 1;
}
else if (a > 20 || b > 20 || c > 20){
return (clac(20, 20, 20));
}
else if (memory[a][b][c]){
return (memory[a][b][c]);
}
else if (a < b && b < c){
memory[a][b][c] = clac(a,b,c-1)+clac(a,b-1,c-1)-clac(a,b-1,c);
}
else {
memory[a][b][c] = clac(a-1,b,c)+clac(a-1,b-1,c)+clac(a-1,b,c-1)-clac(a-1,b-1,c-1);
}
return memory[a][b][c];
}
```
以上是修改的并提交的代码
但是依旧没有全AC
感谢你的回复
by TheIceStar @ 2022-08-06 21:40:26
@[TheIceStar](/user/764616) 我再看看(前面用手机不好调)
by Cstdio_Rabbit @ 2022-08-06 21:44:18
@[TheIceStar](/user/764616) while (a != -1 || b!=-1 || c!=-1){
by Cstdio_Rabbit @ 2022-08-06 21:51:38
**谢谢你**
by TheIceStar @ 2022-08-06 21:53:49