'commit'
This commit is contained in:
17
TangDou/LuoGuBook/20_1_9_3.cpp
Normal file
17
TangDou/LuoGuBook/20_1_9_3.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
int cnt;
|
||||
|
||||
int main() {
|
||||
int n = 10;
|
||||
int u = 1 << n;
|
||||
for (int s = 0; s <= u - 1; s++) {
|
||||
int q = 4;
|
||||
for (int i = n - 1; i >= 0; i--)
|
||||
if (s & (1 << i)) q--;
|
||||
if (!q)cnt++;
|
||||
}
|
||||
cout << cnt << endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user