這是一個非常實用的計算器
想要看密碼就請用Notepad打開C語言文件 然后有一行注釋行://mima...
mima后面的一串數字即為密碼
單片機源程序如下:
- #include<cstdlib>
- #include<iostream>
- #include<iomanip>
- #include<cmath>
- #include<windows.h>
- using namespace std;
- #define size 100
- int a[size+1],n,d,i=0,j;
- //mima267398323513
- main(){
- int sf;
- long long mima;
- cout<<"======================================================="<<endl;
- cout<<"| Calculator 2019 |"<<endl;
- cout<<"| Version 3.98 |"<<endl;
- cout<<"| |"<<endl;
- cout<<"| |"<<endl;
- cout<<"| Adminstrator |"<<endl;
- cout<<"| Welcome to Calculator_64 Professional |"<<endl;
- cout<<"| Update 1907 Professional |"<<endl;
- cout<<"| Designed by Howard Lu |"<<endl;
- cout<<"| |"<<endl;
- cout<<"| |"<<endl;
- cout<<"| C-2019-2021 |"<<endl;
- cout<<"======================================================="<<endl;
- cout<<"Adminstrator,請輸入密碼"<<endl;
- cout<<"密碼:";
- cin>>mima;
- if(mima==267398323513){
- system("cls");
- cout<<"Initialization";
- for(int i=1;i<=3;i++){
- Sleep(1000);
- cout<<".";
- }
- Sleep(1000);
- system("cls");
- cout<<"Initialization";
- for(int i=1;i<=3;i++){
- Sleep(1000);
- cout<<".";
- }
- Sleep(1000);
- system("cls");
- cout<<"C";Sleep(100);
- cout<<"a";Sleep(100);
- cout<<"l";Sleep(100);
- cout<<"c";Sleep(100);
- cout<<"u";Sleep(100);
- cout<<"l";Sleep(100);
- cout<<"a";Sleep(100);
- cout<<"t";Sleep(100);
- cout<<"o";Sleep(100);
- cout<<"r";Sleep(100);
- cout<<"_";Sleep(100);
- cout<<"6";Sleep(100);
- cout<<"4";Sleep(100);
- cout<<" ";Sleep(100);
- cout<<"2";Sleep(100);
- cout<<"0";Sleep(100);
- //cout<<"0";Sleep(100);
- //cout<<".";Sleep(100);
- cout<<"1";Sleep(100);
- //cout<<".";Sleep(100);
- cout<<"9";Sleep(100);
- cout<<" ";Sleep(100);
- cout<<"P";Sleep(100);
- cout<<"R";Sleep(100);
- cout<<"O";Sleep(100);
- cout<<endl;
- do{
- cout<<"================================================================="<<endl;
- cout<<"| |"<<endl;
- cout<<"| 微型電子計算器 |"<<endl;
- cout<<"| |"<<endl;
- cout<<"| |"<<endl;
- cout<<"| 請選擇: |"<<endl;
- cout<<"| 1. 如果想計算加減乘除,請輸入1 |"<<endl;
- cout<<"| 2. 如果想計算開方,請輸入2 |"<<endl;
- cout<<"| 3. 如果想轉換進制數,請輸入3 |"<<endl;
- cout<<"| 4. 如果想要算次方,請輸入4 |"<<endl;
- cout<<"| 5. 如果想要算階乘,請輸入5 |"<<endl;
- cout<<"| 6. 如果想顯示π,請輸入6 |"<<endl;
- cout<<"| 7. 如果想做加法統計,請輸入7 |"<<endl;
- cout<<"| 8. 想知道這一天是星期幾,請輸入8 |"<<endl;
- cout<<"| 9. 想知道從1年1月1日到某年某月月底有幾天,請輸入9 |"<<endl;
- cout<<"| 10.想計算斐波那契數列,請輸入10 |"<<endl;
- cout<<"| 11.關閉程序,請按11 |"<<endl;
- cout<<"| 12.像顯示關于Calculator 請輸入12 |"<<endl;
- cout<<"| 若想進行如1×2+3×4-5+6之類的多項表達式運算,請打開棧計算器 |"<<endl;
- cout<<"| 若想進行24點計算,請打開24點計算器 |"<<endl;
- cout<<"| |"<<endl;
- cout<<"| |"<<endl;
- cout<<"================================================================="<<endl;
- int ds,x,y;
- cin>>ds;
- if(ds==1){
- char x;
- double a,b;int c,d;
- cout<<"請輸入+,-,*,/,%(求余,兩數不可為小數)中的一個運算符號:";cin>>x;
- cout<<"請輸入A數:";cin>>a;
- cout<<"請輸入B數:";cin>>b;
- if(x=='/'){
- cout<<"請問,你想保留幾位小數?:";cin>>c;
- }
- switch(x){
- case '+':cout<<a+b<<endl;break;
- case '-':cout<<a-b<<endl;break;
- case '*':cout<<a*b<<endl;break;
- case '/':if(b!=0) cout<<fixed<<setprecision(c)<<(double)a/b<<endl;else cout<<"Divided by zero!"<<endl;break;
- case '%':c=a;d=b;
- cout<<c%d<<endl;break;
- default:cout<<"Invalid operator!"<<endl;
- }
- system("pause");
- }
- if(ds==2){
- cout<<"請輸入一個你想開方的數:";cin>>x;
- cout<<"請輸入你想保留幾位小數:";cin>>y;
- cout<<fixed<<setprecision(y)<<sqrt(x)<<endl;
- system("pause");
- }
- if(ds==3){
- //cout<<"Please Enter a number(N) base 10:";cin>>n;
- cout<<"輸入一個十進制數:";cin>>n;
- //cout<<"Please Enter a number(d):";cin>>d;
- cout<<"輸入你想把這個數轉化成的進制數(幾進制):";cin>>d;
- do{
- a[++i]=n%d;
- n=n/d;
- }while(n!=0);
- for(j=i;j>=1;j--)cout<<a[j];
- cout<<endl;
- system("pause");
- }
- if(ds==4){
- float a,b,c;
- cout<<"請輸入底數:";cin>>a;
- cout<<"請輸入指數:";cin>>b;
- cout<<"請問你想保留幾位小數:";cin>>c;
- cout<<fixed<<setprecision(c)<<(double)pow(a,b)<<endl;
- system("pause");
- }
- if(ds==5){
- int t,s;
- s=0;
- int a,b,c;
- cout<<"請輸入你想算的階乘的數1:";cin>>a;
- cout<<"請輸入你想算的階乘的數2:";cin>>b;
- cout<<"我們將幫你累加從數1的階乘到數2的階乘"<<endl;
- Sleep(1000);
- for(int i=a;i<=b;++i)
- {
- t=1;
- for (int j=1;j<=i;++j) //求i!
- t*=j;
- s+=t; //累加i!
- }
- cout<<s<<endl;;
- system("pause");
- }
- if(ds==6){
- cout<<"π=3.1415926535897932384626433872395"<<endl;
- system("pause");
- }
- if(ds==7){
- int a,b,sum=0;
- cout<<"請輸入你要統計數的個數:";
- cin>>a;
- for(int i=1;i<=a;i++){
- cin>>b;
- sum=sum+b;
- }
- cout<<"Sum="<<sum<<endl;
- system("pause");
- }
- if(ds==8){
- int day,year,month,day2,date,allday;
- cout<<"請輸入年月日 例 2018 12 31:";
- cin>>year>>month>>date;
- day=year/4-year/100+year/400;
- if (year%400==0) day2=29+31+30+31+30+31+31+30+31+30+31;
- else if (year%100==0) day2=28+31+30+31+30+31+31+30+31+30+31;
- else if (year%4==0) day2=29+31+30+31+30+31+31+30+31+30+31;
- else day2=28+31+30+31+30+31+31+30+31+30+31;
- switch(month){
- case 1:day2=day2+31;break;
- case 2:day2=30+31+30+31+30+31+31+30+31+30+31;break;
- case 3:day2=31+30+31+30+31+31+30+31+30+31;break;
- case 4:day2=30+31+30+31+31+30+31+30+31;break;
- case 5:day2=31+30+31+31+30+31+30+31;break;
- case 6:day2=30+31+31+30+31+30+31;break;
- case 7:day2=31+31+30+31+30+31;break;
- case 8:day2=31+30+31+30+31;break;
- case 9:day2=30+31+30+31;break;
- case 10:day2=31+30+31;break;
- case 11:day2=30+31;break;
- case 12:day2=31;break;
- }
- allday=366*day+365*(year-day)-day2+date;
- if(allday%7==1) cout<<"星期一"<<endl;
- if(allday%7==2) cout<<"星期二"<<endl;
- if(allday%7==3) cout<<"星期三"<<endl;
- if(allday%7==4) cout<<"星期四"<<endl;
- if(allday%7==5) cout<<"星期五"<<endl;
- if(allday%7==6) cout<<"星期六"<<endl;
- if(allday%7==0) cout<<"星期日"<<endl;
-
- system("pause");
- }
- if(ds==9){
- int day,year,month,day2;
- cout<<"請輸入年月,例:2018 12:";
- cin>>year>>month;
- day=year/4-year/100+year/400;
- if (year%400==0) day2=29+31+30+31+30+31+31+30+31+30+31;
- else if (year%100==0) day2=28+31+30+31+30+31+31+30+31+30+31;
- else if (year%4==0) day2=29+31+30+31+30+31+31+30+31+30+31;
- else day2=28+31+30+31+30+31+31+30+31+30+31;
- switch(month){
- case 1:day2=day2;break;
- case 2:day2=31+30+31+30+31+31+30+31+30+31;break;
- case 3:day2=30+31+30+31+31+30+31+30+31;break;
- case 4:day2=31+30+31+31+30+31+30+31;break;
- case 5:day2=30+31+31+30+31+30+31;break;
- case 6:day2=31+31+30+31+30+31;break;
- case 7:day2=31+30+31+30+31;break;
- case 8:day2=30+31+30+31;break;
- case 9:day2=31+30+31;break;
- case 10:day2=30+31;break;
- case 11:day2=31;break;
- case 12:day2=0;break;
- }
- cout<<366*day+365*(year-day)-day2<<endl;
- system("pause");
- }
- if(ds==10){
- cout<<"先輸入一個數(第幾項):";int n,n2;cin>>n;
- cout<<"是想輸出從第一項到第"<<n<<"項的所有數,選1"<<endl;
- cout<<"是想輸出從第一項到第"<<n<<"項的所有數的和,選2"<<endl;
- cin>>n2;
- if(n2==1){
- int a,b,tmp,i;
- a = 0;
- b = 1;
- for(i=0;i<n;i++)
- {
- printf("%d\n",b);
- tmp = b;
- b = a + b;
- a = tmp;
- }
- system("pause");
- }
- if(n2==2){
- int a,b,tmp,i,sum=0;
- a = 0;
- b = 1;
- for(i=0;i<n;i++)
- {
- tmp = b;
- sum=sum+tmp;
- cout<<sum<<endl;
- b = a + b;
- a = tmp;
- }
- cout<<"Sum="<<sum<<endl;
- system("pause");
- }
- }
- if(ds==11) return 0;
- if(ds==12) {
- system("cls");
- cout<<"下面是您的賬戶信息:"<<endl;
- cout<<"Adminstrator"<<endl;
- cout<<"管理員"<<endl;
- cout<<"創建時間:2019/7/29"<<endl;
- cout<<"激活狀態:已激活"<<endl;
- cout<<"激活時間:2019/7/31"<<endl;
- cout<<"管理員認證號:2019-07-29-0001-ASDFG-CLOA-CAL-A0001"<<endl;
- cout<<"信用狀態:未違反任何版權約定,您可以繼續使用"<<endl;
-
- }
- cout<<"是否想要繼續:是1,否2, 發送錯誤信息并關閉程序3:";cin>>sf;
- Sleep(100);
- system("cls");
- if(sf==3){
- cout<<"Sending Messages";
- cout<<".";
- Sleep(500);
- cout<<".";
- Sleep(500);
- cout<<".";
- Sleep(500);
- system("cls");
- cout<<"Sending Messages";
- cout<<".";
- Sleep(500);
- cout<<".";
- Sleep(500);
- cout<<".";
- Sleep(500);
- system("cls");
- }
- //do{
- //cout<<"是否想要繼續:是1,否2, 發送錯誤信息3:";cin>>sf;
- //Sleep(100);
- //system("cls");
- //if(sf==3){
- // cout<<"正在使用高速通道發送錯誤信息";
- // cout<<".";
- // Sleep(500);
- // cout<<".";
- // Sleep(500);
- // cout<<".";
- // Sleep(500);
- // system("cls");
- // cout<<"正在使用高速通道發送錯誤信息";
- // cout<<".";
- // Sleep(500);
- // cout<<".";
- // Sleep(500);
- // cout<<".";
- // Sleep(500);
- // system("cls");
- //}
- //}while(sf==3);
- }while(sf==1);
- }
- else cout<<"Sorry, invaliable password"<<endl;
- }
復制代碼
0.png (5.39 KB, 下載次數: 57)
下載附件
2019-6-27 02:04 上傳
所有資料51hei提供下載:
Calculator.rar
(382.79 KB, 下載次數: 13)
2019-6-26 13:45 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
|