18 lines
389 B
C++
18 lines
389 B
C++
// lanqiao 19695 握手问题(枚举法)
|
|
#include<bits/stdc++.h>
|
|
using namespace std;
|
|
|
|
int main() {
|
|
int ans = 0;
|
|
for(int i = 1; i <=50; i++){
|
|
for(int j = i + 1; j<=50; j++){
|
|
if(!( (i >= 1 && i<= 7) && (j >= 1 && j <= 7) )) ans++;
|
|
// i和j不能同时满足都在[1, 7]范围内
|
|
}
|
|
}
|
|
cout << ans << endl;
|
|
return 0;
|
|
}
|
|
/* 枚举法
|
|
|
|
*/ |