DevC++编译成功,可APPCRASH了,求解……
源码:程序代码:
#include<bits/stdc++.h> #include<windows.h> #include<conio.h> #define version "1.0" #define ut 10000000ll using namespace std; string usernames,password; string s; void delay(long long t) { for (int i=0;i<t;i++); } void welcome() { cout<<"城市生活 version"<<version<<" by WindowsC++工作室"<<endl; delay(40*ut); for (int i=0;i<=100;i++){ printf("加载中…… %d%%\r",i); delay(2*ut); } delay(30*ut); cout<<endl<<endl<<"加载完成!"<<endl; delay(60*ut); } void print(string a) { for(int i=0;i<=a.length();++i) { cout<<a[i]; Sleep(25); } Sleep(1000); return; } int main() { welcome(); system("cls"); void writelog1(); writelog1(); void signid(); signid(); void init(); init(); return 0; } void writelog1() { FILE*outlog=fopen("D:\\HappyGames\\CL\\1.0\\OC.log","a"); time_t rawtime; struct tm *ptminfo; time(&rawtime); ptminfo = localtime(&rawtime); fprintf(outlog,"%02d-%02d-%02d %02d:%02d:%02d OPEN\n",ptminfo->tm_year + 1900, ptminfo->tm_mon + 1, ptminfo->tm_mday,ptminfo->tm_hour, ptminfo->tm_min, ptminfo->tm_sec); } void signid() { print("请输入账号,按“Enter”结束(没有账号输入no):\n"); getline( cin, s ); vector<string> users; { ifstream fin( "D:\\HappyGames\\CL\\1.0\\users.tmp" ); for( string user; getline(fin,user); ) users.push_back( user ); } if( (find(users.begin(),users.end(),s) != users.end())||(s=="root") ) { void signpassword(); signpassword(); } else if(s=="no") { print("前往注册……"); void zhuce(); zhuce(); } else { print("对不起,该账号未注册!2秒后前往注册页面……"); void zhuce(); zhuce(); } } void signpassword() { string defini="D:\\HappyGames\\CL\\1.0\\"; string defi="\\psaawords.tmp"; defini=defini+s+defi; print("你即将登录的账号是:"); print(s); print("输入exit返回上一级!\n"); print("请输入密码,按“Enter”结束:\n"); string sh; getline(cin,sh); char a[100000000001]; for(int i=0;i<=defini.length();i++) { a[i]=defini[i]; } ifstream passin(a); passin>>password; if((s=="root")&&(sh=="admin")) { print("管理系统启动中……"); } else if(password==sh) { print("Hello!"); print(s); print("欢迎来到城市生活!\n"); } else { print("密码不匹配!" ); signpassword(); } } void zhuce() { system("cls"); int nSelect = ::MessageBox(NULL,"欢迎来到注册页面!", "registered", MB_ICONASTERISK); print("用户名:\n"); string sh1; getline(cin,sh1) ; vector<string> users; { ifstream fin( "D:\\HappyGames\\CL\\1.0\\users.tmp" ); for( string user; getline(fin,user); ) users.push_back( user ); } if(find(users.begin(),users.end(),sh1) != users.end() ) { print("用户名被占用!"); zhuce(); } else if((sh1=="root")||(sh1=="资料学习")) { print("非法账号!"); zhuce(); } else { FILE*zhuceidin=fopen("D:\\HappyGames\\CL\\1.0\\users.tmp","a"); char aaa[1000000001]; for(int i=0;i<=sh1.length();i++) { aaa[i]=sh1[i]; } fprintf(zhuceidin,"%s\n",aaa); } } void init() { }
运行到上述红字代码就APPCRASH,求解!