2017校招真題1 星際穿越

c++ 題目代碼很少,主要是如何在O(1)時間輸出滿足要求的這個數字。 注意數據範圍,本題選擇long。題目描述和代碼如下: #include<iostream>#include<math.h>using namespace std;int main(void){    long x;    cin>>x;    long temp = sqrt(x);    if(temp *(temp+1)
相關文章
相關標籤/搜索