题目描述
本题为填空题,只需要算出结果后,在代码中使用输出语句将所填结果输出即可。
请问有多少个序列满足下面的条件:
序列的长度为 5。
序列中的每个数都是 1 到 10 之间的整数。
序列中后面的数大于等于前面的数。
运行限制
- 最大运行时间:1s
- 最大运行内存: 128M
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int count = 0;
for(int i = 1;i<=10;i++){
for(int j = 1;j<=10;j++){
for(int k = 1;k<=10;k++){
for(int a = 1;a<=10;a++){
for(int b = 1;b<=10;b++){
if(b>=a&&a>=k&&k>=j&&j>=i){
count++;
}
}
}
}
}
}
cout<<count;
return 0;
}