#include
#include
#include
#include
#include
using namespace std;
void _0621s1();
void _0621s2();
void _0621s3();
void _0621s5();
void _0621s6();
void _0621s7();
int i, j, k, c;
int main()
{
?system("title 0621zhangsan");
?system("mode con cols=76 lines=35"); ?//窗口寬度高度?
?system("date /T");
?system("TIME /T");
?system("VER");//顯示windows版本?
?system("color E4");
?_0621s1();
?return 0;
}
void _0621s1()//主界面
{
?cout<< "\t★★★★★\t\t\t\t\t★★★★★\n";
?cout<< "\t★\t★\t\t\t\t\t★\t★\n";
?cout<< "\t★\t★\t\t\t\t\t★\t★\n";
?cout<< "\t★\t★\t\t\t\t\t★\t★\n";
?cout<< "\t★\t★\t\t\t\t\t★\t★\n";
?cout<< "\t★★★★★★★★★★★★★★★★★★★★★★★★★★★★★\n";
?cout<< "\t★\t\t\t\t\t\t\t★\n";
?cout<< "\t★\t\t\t\t\t\t\t★\n";
?cout<< "\t★\t******************************************\t★\n";
?cout<< "\t★\t**\t ? 歡迎使用變形菜單系統(tǒng)\t\t**\t★\n";
?cout<< "\t★\t**\t\t\t\t\t**\t★\n";
?cout<< "\t★\t**——————例題演示系統(tǒng)———————**\t★\n";
?cout<< "\t★\t******************************************\t★\n";
?cout<< "★★★★★★★\t\t\t\t\t\t ? ?★★★★★★★\n";
?cout<< "\t★\t\t\t\t\t\t\t★\n";
?cout<< "\t★\t\t\t\t\t\t\t★\n";
?cout<< "★★★★★★★\t\t\t\t\t\t ? ?★★★★★★★\n";
?cout<< "\t★\t\t\t\t\t\t\t★\n";
?cout<< "\t★\t\t\t\t\t\t\t★\n";
?cout<< "★★★★★★★-------------機(jī)器貓現(xiàn)在就帶你研究-------------★★★★★★★\n";
?cout<< "\t★\t\t\t\t\t\t\t★\n";
?cout<< "\t★\t\t\t\t\t\t\t★\n";
?cout<< "\t★\t\t\t\t\t\t\t★\n";
?cout<< "\t★\t\t\t\t\t\t\t★\n";
?cout<< "\t★\t\t\t\t\t\t\t★\n";
?cout<< "\t★\t\t-----版權(quán)所有,侵權(quán)必究-----\t\t★\n";
?cout<< "\t★\t\t\t\t\t\t\t★\n";
?cout<< "\t★★★★★★★★★★★★★★★★★★★★★★★★★★★★★\n";
?cout<< "進(jìn)入系統(tǒng)請(qǐng)輸入密碼(您共有三次機(jī)會(huì)),退出系統(tǒng)請(qǐng)按0號(hào)鍵\n";
?_0621s2();
}
void _0621s2()//密碼
{
?long p = 123456;
?long p1;
?int n = 3;
?char c;
?while (true)
?{
??? ?cin >>p1;
??? ?if (p1 == p)
??? ?{
??? ??? ?cout<< "密碼正確,請(qǐng)按任意鍵繼續(xù)"<< endl;
??? ??? ?c = getch();
??? ??? ?system("cls");
??? ??? ?_0621s3();
??? ??? ?break;
??? ?}
??? ?else
??? ?{
??? ??? ?--n;
??? ??? ?cout<< "密碼錯(cuò)誤,請(qǐng)重新輸入,你還有"<< n<< "次機(jī)會(huì)"<< endl;
??? ?}
??? ?if (n == 0)
??? ?{
??? ??? ?system("cls"); //清屏功能?
??? ??? ?cout<< "\t\t\t\t\n";
??? ??? ?cout<< "\t\t\t\t\n";
??? ??? ?cout<< "\t\t\t\t\n";
??? ??? ?cout<< "\t\t\t\t\n";
??? ??? ?cout<< "\t\t\t\t\n";
??? ??? ?cout<< "\t\t\t\t\n";
??? ??? ?cout<< "\t\t\t\t\n";
??? ??? ?cout<< "\t ? ? ? ?|\_/| \n";
??? ??? ?cout<< "\t ? ? ? ? ?| *x* | \n";
??? ??? ?cout<< "\t ? \_____/ ? |\n";
??? ??? ?cout<< "\t ? ?| ? | \n";
??? ??? ?cout<< "\t ?。堋 ? ? ? ノ ?\n";
??? ??? ?cout<< "\t ((( (/ ̄ ̄ ̄ ̄(/ ヽ) \n";
??? ??? ?cout<< "您三次機(jī)會(huì)已用完,歡迎您的使用!ByeBye!....................";
??? ?}
?}
}
void _0621s3()
{
?while (true)
?{
??? ?char b;
??? ?system("cls");
??? ?cout<< "\t\t\t\t\n";
??? ?cout<< "\t\t\t\t\n";
??? ?cout<< "\t\t\t\t\n";
??? ?cout<< "\t\t\t\t\n";
??? ?cout<< "\t\t\t\t\n";
??? ?cout<< "\t\t\t\t\n";
??? ?cout<< "\t\t\t\t\n";
??? ?cout<< "\t\t本系統(tǒng)提供的相關(guān)例題演示程序如下:\n";
??? ?cout<< "\t\t\t\t\n";
??? ?cout<< "\t\t\t0.退出系統(tǒng)\n";
??? ?cout<< "\t\t\t\t\n";
??? ?cout<< "\t\t\t3.輸出斐波那契數(shù)列:\n";
??? ?cout<< "\t\t\t\t\n";
??? ?cout<< "\t\t\t4.輸出n內(nèi)的所有素?cái)?shù):\n";
??? ?cout<< "\t\t\t\t\n";
??? ?cout<< "\t\t\t5.輸出n內(nèi)的所有完數(shù):\n";
??? ?cout<< "請(qǐng)輸入功能序號(hào)<0-4>:"<< endl;
??? ?cin >>b;
??? ?switch (b)
??? ?{
??? ?case '0':return;
??? ?case '3':_0621s5(); break;
??? ?case '4':_0621s6(); break;
??? ?case '5':_0621s7(); break;
??? ?}
?}
}
void _0621s5()//斐波那契數(shù)列
{
?int f1 = 0, f2 = 1, t, n = 1, p;
?cout<< "請(qǐng)輸入n:";
?cin >>p;
?cout<< "數(shù)列第1個(gè):"<< f1<< endl;
?cout<< "數(shù)列第2個(gè):"<< f2<< endl;
?for (n = 3; n<= p; n++) {
??? ?t = f2;
??? ?f2 = f1 + f2;
??? ?f1 = t;
??? ?cout<< "數(shù)列第"<< n<< "個(gè):"<< f2<< endl;
?}
?cout<< endl;
?cout<< "按下任意鍵返回選擇菜單"<< endl;
?c = getch();
}
void _0621s6()//完數(shù)
{
?cout<< "請(qǐng)輸入n:";
?int n;
?cin >>n;
?for (int i = 2; i< n; ++i)
?{
??? ?int k;
??? ?for (k = 2; k< n; ++k)
??? ??? ?if (i % k == 0)break;
??? ?if (k == i)
??? ??? ?cout<< i<< " ";
?}
?cout<< endl;
?cout<< "按下任意鍵返回選擇菜單"<< endl;
?c = getch();
}
void _0621s7()//
{
?int i, n, sum;
?int a = 1, b;
?cout<< "請(qǐng)輸入n:";
?cin >>b;
?for (n = a; n<= b; n++)
?{
??? ?sum = 0;
??? ?for (i = 1; i< n; i++)
??? ?{
??? ??? ?if (n % i == 0)
??? ??? ?{
??? ??? ??? ?sum = sum + i;
??? ??? ?}
??? ?}
??? ?if (sum == n)
??? ?{
??? ??? ?cout<< n<< endl;
??? ?}
?}
?cout<< endl;
?cout<< "按下任意鍵返回選擇菜單"<< endl;
?c = getch();
}
密碼:123456
你是否還在尋找穩(wěn)定的海外服務(wù)器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機(jī)房具備T級(jí)流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確流量調(diào)度確保服務(wù)器高可用性,企業(yè)級(jí)服務(wù)器適合批量采購(gòu),新人活動(dòng)首月15元起,快前往官網(wǎng)查看詳情吧