Initial commit
This commit is contained in:
15
15lanqiao/test1-1.cpp
Normal file
15
15lanqiao/test1-1.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int tot = (50*49) / 2, cnt = (7*6) / 2;
|
||||
cout << tot - cnt << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
总共有50人参与会议,如果按照常规情况,即每个人与除了自己以外的所有人各握手一次
|
||||
握手总数tot=49+48+...+1=(50*49)/2
|
||||
现在有7个人没有互相握手,这7这个人本来应该握手的次数 cnt=6+5+...+1=(7*6)/2
|
||||
实际握手次数=总的握手次数tot-7人的情况cnt (tot - cnt)
|
||||
*/
|
||||
Reference in New Issue
Block a user