C++程序菜单,如何将它完善?

图片说明
#include
#include
#include
#include
#include
using namespace std;

bool CheckPassWord(string password)/*以"*"输入密码,三次机会*/
{
bool judge = false;
int i = 0;
int times = 1;
string s;
char ch;
char pw[50];
while(times <= 3)
{
i = 0;
while((ch = _getch()) != '\r')
{
if(ch == '\b' && i > 0)//退格
{
printf("\b \b");
i--;
}
else
{
pw[i++] = ch;
cout << '*';
}
}
pw[i] = '\0';
cout << endl;
if(password.compare(pw) != 0)
{
if(times == 3)
cout << "密码错误,退出!" << endl << endl;
else
cout << "密码错误,剩余" << (3-times) << "次机会:";
times++;
}
else
{
cout << "密码正确!" << endl << endl;
judge = true;
return judge;
}
}
if(times == 4)
return judge;
return judge;
}
void pic()
{
cout<<" $---------------------------------$"<<endl;
cout<<" | |"<<endl;
cout<<" | 欢迎进入数列例题系统 | "<<endl;
cout<<" | |"<<endl;
cout<<" @---------------------------------@"<<endl;

}
void menu()
{

cout<<"本系统提供以下功能:"<<endl;
cout<<"1.输出所有水仙花数"<<endl;
cout<<"2.输出斐波那契数列"<<endl;
cout<<"3.输出200内素数"<<endl;
cout<<"4.输出200内完数"<<endl;

cout<<"0.返回主界面"<<endl;

}
void narcissus(int number)
{
int x,y,z,n;
cout<<"narcissus number are:"<<endl;
for(n=100;n<1000;n++)
{ x=n/100;
y=n/10-x*10;
z=n%10;
if(n==x*x*x+y*y*y+z*z*z)
cout<<n<<" ";
}
}

int FibonacciSequence(int n)
{
if (n <= 2)
{
return 1;
}
int a = 1;
int b = 1;
int c = 1;
for (int i = 3; i <= n; i++)
{
a = b;
b = c;
c = a + b;
}
return c;
}

int prime(int n)
{
int m;
for(m=2;m<=(int)sqrt(n);m++)//从2到算术平方根
if(n%m==0)return 0;//存在约数,非素数,返回0
return 1;//是素数,返回1

}
void per(int)
{
int i, j, sum = 0, k = 0;
for (i = 2; i < 200; i++) {
for (j = 1; j < i; j++) {
if (i % j == 0) { //j为i的因子
k += j; //所有因子累加
}
}
sum = k; //传递累加变量的值
k = 0; //每判断完一个数,将累加变量置零
if (sum == i) { //将完数写成因子相加式
printf("%d=", i);
for (i = 1; i < sum; i++) {
if (sum%i == 0) {
printf("%d", i);
if (i < sum/2) printf("+");
}

}
printf("\n");
}
}
}

int main()
{ int i,j,sum,k,x,y,z,n;
pic();
string password = "123456"; //原始密码
cout << "退出系统请按0,进入系统请输入密码(3次机会):";
if(CheckPassWord(password)!=true)

      prime();

 return 0;
 return 1;

}


既然你都做了界面了,那就用VC或者QT写吧