1 2 3 4 5 6 7
4-5-3-6-2-7-1
答案是(n-1)/2
#include<cstdio> using namespace std; int n; int main(){ scanf("%d",&n); printf("%d ",(n-1)/2); return 0; }