没什么好说的,上代码
//应用密码系统
//system("cls");
#include<bits/stdc++.h>
#include<windows.h>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <conio.h>
#include <cmath>
using namespace std;
long long mi=10281234,shu;
long long sr=0;
void towhere();
void Time();
void ji();
void test01(){
system("cls");
//2、创建流对象 ofs可以换成其他名字
ofstream ofs;
//3、指定打开方式
ofs.open("cout.txt",ios::out );
//4、写内容
string str;
cin>>str;
ofs<<str;
//5、(重要!!!)关闭文件
ofs.close();
cout << "输出内容成功!" << endl;
system("pause");
towhere();
}
int main()
{
system("color 0A");
while(1){
cout<<"请";
Sleep(50);
cout<<"输";
Sleep(50);
cout<<"入";
Sleep(50);
cout<<"应";
Sleep(50);
cout<<"用";
Sleep(50);
cout<<"密";
Sleep(50);
cout<<"码";
Sleep(50);
cin>>shu;
if(shu!=mi){
cout<<"请重试\n";
Sleep(350);
}
else{
break;
}
}
towhere();
}
void towhere(){
system("color 0A");
char w;
SYSTEMTIME st;//定义本地时间变量,该变量为结构体
GetLocalTime(&st);//获取本地时间函数,参数为时间变量指针
while(1){
system("cls");
cout<<"---------------------------"<<endl;
cout<<" 欢迎,你要干什么?"<<endl;
if(st.wHour<10) cout<<"0";
cout<<" "<<st.wHour<<":";
if(st.wMinute<10) cout<<"0";
cout<<st.wMinute<<endl;
cout<<" "<<st.wYear<<"/"<<st.wMonth<<"/"<<st.wDay<<endl;
cout<<endl;
cout<<" 1.查看时间 2.打开计算器 "<<endl;
cout<<endl;
cout<<" 3.创建记事本 4.敬请期待"<<endl;
cout<<endl;
cout<<"---------------------------"<<endl;
cin>>w;
if(w=='1') Time();
else if(w=='2') ji();
else if(w=='3') test01();
else if(w=='4') towhere();
else{towhere();}
}
}
void Time(){
system("cls");
SYSTEMTIME st;//定义本地时间变量,该变量为结构体
GetLocalTime(&st);
while(1){
char n;
cout<<st.wYear<<"年";//显示某年
cout<<st.wMonth<<"月";//显示某月
cout<<st.wDay<<"日";//显示某日
int x=st.wDayOfWeek;
switch(x){
case 0: cout<<"星期"<<"日"<<endl;break;
case 1: cout<<"星期"<<"一"<<endl;break;
case 2: cout<<"星期"<<"二"<<endl;break;
case 3: cout<<"星期"<<"三"<<endl;break;
case 4: cout<<"星期"<<"四"<<endl;break;
case 5: cout<<"星期"<<"五"<<endl;break;
case 6: cout<<"星期"<<"六"<<endl;break;
}
if(st.wHour<10) cout<<"0";
cout<<st.wHour<<"时";//显示某时
if(st.wMinute<10) cout<<"0";
cout<<st.wMinute<<"分";//显示某分
if(st.wSecond<10) cout<<"0";
cout<<st.wSecond<<"秒"<<endl;//显示某分
system("pause");
towhere();
}
}
void ji(){
system("cls");
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
cout<<endl;
cout<<" 提示:只有两个数!\n";
cout<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
long double a,b,c;
char f;
cin>>a>>f>>b;
if(f=='+'){
c=a+b;
}
if(f=='-'){
c=a-b;
}
if(f=='*'){
c=a*b;
}
if(f=='/'){
c=a/b;
}
cout<<a<<f<<b<<"="<<c;
system("pause");
towhere();
}