C++编译密码问题?
...#include <stdlib.h>
...
int bymm();
...
void main()
{
zhucaid();
}
void zhucaid(void)
{
cout<<"************************"<<endl;
cout<<"5--译文编译密码"<<endl;
cout<<"************************"<<endl;
cout<<"请输入您的选着:"<<endl;
int chch;
char ch;
for(;;)
{
cin>>chch;
if(chch==0)break;
switch(chch)
{
case 5:system("cls");//清屏
for(;;)
{
bymm();
cout<<endl<<"是否继续?(继续'n'返回'y')";
cin>>ch;
if(ch=='y')
{
system("cls");
zhucaid();
}
if(ch=='n')
{
system("cls");
continue;
}
}
break;
}
int bymm()
{
char c;
while((c=getchar())!='\n')
{
if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
{
c=c+4;
if(c>'Z'&&c<='Z'+4||c>'z')c=c-26;
}
cout<<c;
}
cout<<endl;
return 0;
}
//为什么在switch 里 调用 bymm();函数。。不起作用???
追问:等等。。。可以加上注释吗??谢谢了