#include<bits/stdc++.h>
using namespace std;
void wait(float n){
clock_t delay=n*CLOCKS_PER_SEC;
clock_t start=clock();
while(clock()-start<delay);
}
int main(){
wait(2);
cout<<"———————————————————moon———————————————————";
wait(2);
for(int k=0;k<10;k++){
wait(0.05);
for (int i=1;i<=80;i++){
wait(0.01);
for (int j=1;j<=(80-1)/2+1-i;j++){
cout << " ";
}
for (int j=1;j<=i-((80-1)/2+1);j++){
cout << " ";
}
for (int j=1;(j<=2*i-1)&&(i<=(80-1)/2+1);j++){
cout<<"*";
}
for (int j=1;(j<=80-(2*(i-((80-1)/2+1))))&&(i>((80-1)/2+1));j++){
cout<<"*";
}
cout<<endl;
}
}
wait(1);
cout<<"Welcome to use this app. Before use this app, you should to log on first."<<endl;
wait(1);
cout<<"Input '1' to log on."<<endl<<"Input '2' to register"<<endl;
int temp;
cin>>temp;
int password1,password2;
string name;
int password3;
string name1;
if(temp==1){
log:
cout<<"user name:"<<endl;
cin>>name;
cout<<"password:"<<endl;
cin>>password1;
freopen("user name.moon","r",stdin);
cin>>name1;
fclose(stdin);
freopen("user password.moon","r",stdin);
cin>>password3;
fclose(stdin);
if(name1!=name||password1!=password3){
cout<<"name or password is worry!"<<endl;
goto log;
}
else{
wait(2);
cout<<"log right!"<<endl;
}
}
if(temp==2){
register1:
cout<<"user name:"<<endl;
cin>>name;
cout<<"new password:"<<endl;
cin>>password1;
cout<<"input the password again:"<<endl;
cin>>password2;
if(password1==password2){
freopen("user name.moon","w",stdout);
cout<<name;
fclose(stdout);
freopen("user password.moon","w",stdout);
cout<<password1;
fclose(stdout);
wait(2);
cout<<"register right!"<<endl;
}
else{
cout<<"password is different!"<<endl;
goto register1;
}
}
wait(2);
cout<<name<<"! Hello! What do you want to do?"<<endl;
return 0;
}
草稿本111
于 2024-11-29 13:25:31 首次发布