do {
cout<<"请输入您的密码:"; cout<<endl; for(i=0;i<6;i++) {
password1[i]=getch(); putch('*'); }
password1[i]=0; cout<<endl;
cout<<"请重新输入你的密码:"<<endl; for(i=0;i<6;i++) {
password2[i]=getch(); putch('*'); }
password2[i]=0; cout<<endl;
if(strcmp(password1,password2)==0) {
strcpy(password,password1); break; } else
cout<<"输入有错,再来."<<endl; }while(1); }
char*person::get_password() {
return password; }
int person::getmonth()//计算存款时间 {
time_t t; t=time(NULL); tm *T=gmtime(&t); int y=T->tm_year+1900; int m=T->tm_mon+1; int d=T->tm_mday; int sum; if(d>=day) { sum=(y-year)*12+(m-month); } else { sum=(y-year)*12+(m-month-1); //return sum; } if(sum!=0) { year=y; month=m; day=d; } return sum; }
void person::set_address() {
cout<<"请输入您的地址:\n"; cin>>address; time_t t; t=time(NULL); tm* T=gmtime(&t); year=T->tm_year+1900; month=T->tm_mon+1; day=T->tm_mday; }