其实这题可以用循环
#include <bits/stdc++.h>
using namespace std;
int main() {
int a,b,c,d,e,f,g,h,i,j,k,v;
for(a = 0;a <= 10;a++){
for(b = 0;b <= 10;b++){
for(c = 0;c <= 10;c++){
for(d = 0;d <= 10;d++){
for(e = 0;e <= 10;e++){
for(f = 0;f <= 10;f++){
for(g = 0;g <= 10;g++){
for(h = 0;h <= 10;h++){
for(i = 0;i <= 10;i++){
for(j = 0;j <= 10;j++){
if(a+b+c+d+e+f+g+h+i+j == 90) v++;
}
}
}
}
}
}
}
}
}
}
cout << v;
}
想什么呢?
共 2 条回复
@wc122 暴力枚举都没你这么暴力
666十亿次