C++ 中 n 個圓的最大交點數


在本教程中,我們將討論一個程式,該程式用於找出 n 個圓的最大交點

為此,我們將獲得圓的數量。我們的任務是找出給定數量的圓相交的最大數量。

示例

 即時演示

#include <bits/stdc++.h>
using namespace std;
//returning maximum intersections
int intersection(int n) {
   return n * (n - 1);
}
int main() {
   cout << intersection(3) << endl;
   return 0;
}

輸出

6

更新於: 09-Sep-2020

114 次瀏覽

開啟您的 職業生涯

參加課程並獲得認證

開始學習
廣告
© . All rights reserved.