?? template.cpp
字號:
//============================
//程序名稱: .cpp
//程序描述:
//作者:
//日期:
//版本號: V0.0.1
//============================
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> a;
for(int i=2; i<10000; i+=2) // 構造10000之內的完數表
{
int sum=1;
for(int j=2; j<=i/2; j++)
if(i%j==0)
sum += j;
if(sum==i)
a.push_back(i); // add an element to the end of the vector
}
for(int n; cin>>n; ) // 開始處理輸入數據
{
cout<<n<<":";
for(int i=0; i<a.size(); ++i) // 打印每個n之內的完數
if(a[i]<=n) cout<<" "<<a[i];
cout<<"\n";
}
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -