666

wc122 2025-08-01 9:42:59 2025-08-01 9:43:29 14

其实这题可以用循环

#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; 

}

想什么呢?

时间超限的代码!

{{ vote && vote.total.up }}

共 2 条回复

wc02222

@wc122 暴力枚举都没你这么暴力

lyh100 CSP-J2二等

666十亿次