lolicong Posted November 9, 2019 Share Posted November 9, 2019 简体代码: 折叠 /*******************************************************/ /**口袋妖怪孵蛋成本计算器 / For PokeMMO by NightmareDD**/ /*******************************************************/ #include <iostream> #include <iomanip> using namespace std; int main(){ // 预估1v单价 ; int Estimate_cost=0; // 成品v个数 ; int number=0; // 消耗1v个数 ; int count_of_consume=0; // 消耗锁属性个数 ; int count_of_powerlock=0; // 从0开始的消耗锁属性个数 ; int count_of_powerlock_0=0; // 锁属性道具单价 ; int powerlock_price=10000; // 预估价格 ; int Estimated_price1=0,Estimated_price2=0,Estimated_price3=0; // 从0开始的预估价格 ; int Estimated_price1_0=0,Estimated_price2_0=0,Estimated_price3_0=0; // 性别选择次数 ; int ss_times=0; // 从0开始性别选择次数 ; int ss_times_of_0=0; // 设置性别选择费用 ; // "The Basic price of sex selection" change to "basic_ss_preic"; // "The highest price of sex selection" change to "highest_ss_preic"; int basic_ss_preic=5000,highest_ss_preic=21000; // 循环判断函数 ; int condition=0; // 评估次数 ; int times=0; // 版本号 ; string version="3.2[完整版]"; // 程序介绍与更新内容 cout<<"====================================================="<<endl; cout<<"‖孵蛋成本计算器 For PokeMMO By NightmareDD‖Ver: "<<version<<endl; cout<<"====================================================="<<endl; cout<<"‖★修正了公式算法,很遗憾以前的算法居然是错误的★"<<endl; cout<<"‖★在录入[v的个数]时录入非1-6的整数将会终止程序★"<<endl; // 循环 ; while(condition=-1){ // 评估次数 times++; cout<<"=====================第 "<<times<<" 次预估====================="<<endl; cout<<"‖输入预估1v成本:"; // 录入数据 cin>>Estimate_cost; cout<<"‖预期成品的v的个数:"; // 录入最后做完时的V的个数 cin>>number; // 判断录入的成品v个数 并计算相应的需要消耗的v的个数 switch(number){ case 1: count_of_consume = 1; count_of_powerlock =1; count_of_powerlock_0=1; ss_times = 1; ss_times_of_0 = 1; break; case 2: count_of_consume = 2; count_of_powerlock =2; count_of_powerlock_0 =4; ss_times = 1; ss_times_of_0 = 3; break; case 3: count_of_consume = 4; count_of_powerlock =6; count_of_powerlock_0=10; ss_times = 3; ss_times_of_0 = 7; break; case 4: count_of_consume = 8; count_of_powerlock =14; count_of_powerlock_0=22; ss_times = 7; ss_times_of_0 = 15; break; case 5: count_of_consume = 16; count_of_powerlock =30; count_of_powerlock_0=46; ss_times = 15; ss_times_of_0 = 31; break; case 6: count_of_consume = 32; count_of_powerlock =62; count_of_powerlock_0=94; ss_times = 31; ss_times_of_0 = 63; break; default: cout<<"‖"<<endl; cout<<"‖提示:请输入整数。"<<endl; cout<<"‖提示:最高只能制作6v。"<<endl; cout<<"‖提示:不需要绑定属性与选择性别者生蛋不需要任何费用。"<<endl; cout<<"‖"<<endl; cout<<"‖★★下次再见,在键盘上按下任意键本关闭程序★★"<<endl; cout<<"====================================================="<<endl; return 88; } // (1) 计算预估消耗 // 计算无性预估 1v成本价格 * 消耗1v个数 + 道具锁个数 * 单价 Estimated_price1= Estimate_cost * count_of_consume + (count_of_powerlock * powerlock_price); // 计算有性最低预估 1v成本价格 * 消耗1v个数 + 道具锁个数 * 单价 + 性别选择次数 * 性别选择价格(最低价) Estimated_price2= Estimate_cost * count_of_consume + (count_of_powerlock * powerlock_price) + (ss_times * basic_ss_preic); // 计算有性最高预估 1v成本价格 * 消耗1v个数 + 道具锁个数 * 单价 + 性别选择次数 * 性别选择价格(最高价) Estimated_price3= Estimate_cost * count_of_consume + (count_of_powerlock * powerlock_price) + (ss_times * highest_ss_preic); // (2) 计算从0开始的预估消耗 if(number!=1){ // 计算无性预估 1v成本价格 * 消耗1v个数 + 道具锁个数 * 单价 Estimated_price1_0= Estimate_cost * count_of_consume + powerlock_price * count_of_powerlock_0; // 计算有性最低预估 1v成本价格 * 消耗1v个数 + 道具锁个数 * 单价 + 性别选择次数 + 性别选择价格(最低价) Estimated_price2_0= Estimate_cost * count_of_consume + powerlock_price * count_of_powerlock_0 + ss_times_of_0 * basic_ss_preic; // 计算有性最高预估 1v成本价格 * 消耗1v个数 + 道具锁个数 * 单价 + 性别选择次数 + 性别选择价格(最高价) Estimated_price3_0= Estimate_cost * count_of_consume + powerlock_price * count_of_powerlock_0 + ss_times_of_0 * highest_ss_preic; // (1) 输出特殊提示 cout<<"‖"<<endl; cout<<"‖"<<"●[特殊](以每一只都是0v为基础): "<<endl; // 输出从0开始的预估消耗 - 无性别选择时 cout<<"‖"<<"预消耗 "<<count_of_powerlock_0<<" 个锁属性道具。"<<endl; cout<<"‖"<<"[无]性别选择时: "<<endl; cout<<"‖"<<"预消耗 "<<Estimated_price1_0<<" 游戏币。"<<endl; // 输出从0开始的预估消耗 - 有性别选择时 cout<<"‖"<<"[有]性别选择时: "<<endl; cout<<"‖"<<"预选择性别 "<<ss_times_of_0<<" 次。"<<endl; cout<<"‖"<<"预消耗 "<<Estimated_price2_0<<" 至 "<<Estimated_price3_0<<" 之间的游戏币。"<<endl; // (2) 输出普通提示 cout<<"‖"<<endl; cout<<"‖"<<"●[普通](以每一只都是1v为基础): "<<endl; // 输出预估消耗 - 无性别选择时 cout<<"‖"<<"预消耗 "<<count_of_powerlock<<" 个锁属性道具。"<<endl; cout<<"‖"<<"[无]性别选择时: "<<endl; cout<<"‖"<<"预消耗 "<<Estimated_price1<<" 游戏币。"<<endl; // 输出预估消耗 - 有性别选择时 cout<<"‖"<<"[有]性别选择时: "<<endl; cout<<"‖"<<"预选择性别 "<<ss_times<<" 次。"<<endl; cout<<"‖"<<"预消耗 "<<Estimated_price2<<" 至 "<<Estimated_price3<<" 之间的游戏币。"<<endl; cout<<"====================================================="<<endl; }else if(number=1){ // 输出预估消耗 - 无性别选择时 cout<<"‖"<<"预估总共消耗 "<<count_of_powerlock<<" 个锁属性道具。"<<endl; cout<<"‖"<<"预估总共消耗 "<<Estimated_price1<<" 游戏币。(不需要选择性别的情况)"<<endl; // 输出预估消耗 - 有性别选择时 cout<<"‖"<<"预估总共消耗 "<<Estimated_price2<<" 至 "<<Estimated_price3<<" 之间的游戏币。"<<endl; cout<<"====================================================="<<endl; } } return 88; } 繁体代码: 折叠 /*******************************************************/ /**寶可夢孵蛋成本計算器 / For PokeMMO by NightmareDD**/ /*******************************************************/ #include <iostream> #include <iomanip> using namespace std; int main() { // 預估1v單價 ; int Estimate_cost=0; // 成品v個數 ; int number=0; // 消耗1v個數 ; int count_of_consume=0; // 消耗鎖屬性個數 ; int count_of_powerlock=0; // 從0開始的消耗鎖屬性個數 ; int count_of_powerlock_0=0; // 鎖屬性道具單價 ; int powerlock_price=10000; // 預估價格 ; int Estimated_price1=0,Estimated_price2=0,Estimated_price3=0; // 從0開始的預估價格 ; int Estimated_price1_0=0,Estimated_price2_0=0,Estimated_price3_0=0; // 性別選擇次數 ; int ss_times=0; // 從0開始性別選擇次數 ; int ss_times_of_0=0; // 設置性別選擇費用 ; // "The Basic price of sex selection" change to "basic_ss_preic"; // "The highest price of sex selection" change to "highest_ss_preic"; int basic_ss_preic=5000,highest_ss_preic=21000; // 迴圈判斷函數 ; int condition=0; // 評估次數 ; int times=0; // 版本號 ; string version="3.2[完整版]"; // 程式介紹與更新內容 cout<<"====================================================="<<endl; cout<<"‖孵蛋成本計算器 For PokeMMO By NightmareDD‖Ver: "<<version<<endl; cout<<"====================================================="<<endl; cout<<"‖★修正了公式演算法,很遺憾以前的演算法居然是錯誤的★"<<endl; cout<<"‖★在錄入[v的個數]時錄入非1-6的整數將會終止程式★"<<endl; // 迴圈 ; while(condition=-1){ // 評估次數 times++; cout<<"=====================第 "<<times<<" 次預估====================="<<endl; cout<<"‖輸入預估1v成本:"; // 錄入資料 cin>>Estimate_cost; cout<<"‖預期成品的v的個數:"; // 錄入最後做完時的V的個數 cin>>number; // 判斷錄入的成品v個數 並計算相應的需要消耗的v的個數 switch(number){ case 1: count_of_consume = 1; count_of_powerlock =1; count_of_powerlock_0=1; ss_times = 1; ss_times_of_0 = 1; break; case 2: count_of_consume = 2; count_of_powerlock =2; count_of_powerlock_0 =4; ss_times = 1; ss_times_of_0 = 3; break; case 3: count_of_consume = 4; count_of_powerlock =6; count_of_powerlock_0=10; ss_times = 3; ss_times_of_0 = 7; break; case 4: count_of_consume = 8; count_of_powerlock =14; count_of_powerlock_0=22; ss_times = 7; ss_times_of_0 = 15; break; case 5: count_of_consume = 16; count_of_powerlock =30; count_of_powerlock_0=46; ss_times = 15; ss_times_of_0 = 31; break; case 6: count_of_consume = 32; count_of_powerlock =62; count_of_powerlock_0=94; ss_times = 31; ss_times_of_0 = 63; break; default: cout<<"‖"<<endl; cout<<"‖提示:請輸入整數。"<<endl; cout<<"‖提示:最高只能製作6v。"<<endl; cout<<"‖提示:不需要綁定屬性與選擇性別者生蛋不需要任何費用。"<<endl; cout<<"‖"<<endl; cout<<"‖★★下次再見,在鍵盤上按下任意鍵本關閉程式★★"<<endl; cout<<"====================================================="<<endl; return 88; } // (1) 計算預估消耗 // 計算無性預估 1v成本價格 * 消耗1v個數 + 道具鎖個數 * 單價 Estimated_price1= Estimate_cost * count_of_consume + (count_of_powerlock * powerlock_price); // 計算有性最低預估 1v成本價格 * 消耗1v個數 + 道具鎖個數 * 單價 + 性別選擇次數 * 性別選擇價格(最低價) Estimated_price2= Estimate_cost * count_of_consume + (count_of_powerlock * powerlock_price) + (ss_times * basic_ss_preic); // 計算有性最高預估 1v成本價格 * 消耗1v個數 + 道具鎖個數 * 單價 + 性別選擇次數 * 性別選擇價格(最高價) Estimated_price3= Estimate_cost * count_of_consume + (count_of_powerlock * powerlock_price) + (ss_times * highest_ss_preic); // (2) 計算從0開始的預估消耗 if(number!=1){ // 計算無性預估 1v成本價格 * 消耗1v個數 + 道具鎖個數 * 單價 Estimated_price1_0= Estimate_cost * count_of_consume + powerlock_price * count_of_powerlock_0; // 計算有性最低預估 1v成本價格 * 消耗1v個數 + 道具鎖個數 * 單價 + 性別選擇次數 + 性別選擇價格(最低價) Estimated_price2_0= Estimate_cost * count_of_consume + powerlock_price * count_of_powerlock_0 + ss_times_of_0 * basic_ss_preic; // 計算有性最高預估 1v成本價格 * 消耗1v個數 + 道具鎖個數 * 單價 + 性別選擇次數 + 性別選擇價格(最高價) Estimated_price3_0= Estimate_cost * count_of_consume + powerlock_price * count_of_powerlock_0 + ss_times_of_0 * highest_ss_preic; // (1) 輸出特殊提示 cout<<"‖"<<endl; cout<<"‖"<<"●[特殊](以每一隻都是0v為基礎): "<<endl; // 輸出從0開始的預估消耗 - 無性別選擇時 cout<<"‖"<<"預消耗 "<<count_of_powerlock_0<<" 個鎖屬性道具。"<<endl; cout<<"‖"<<"[無]性別選擇時: "<<endl; cout<<"‖"<<"預消耗 "<<Estimated_price1_0<<" 遊戲幣。"<<endl; // 輸出從0開始的預估消耗 - 有性別選擇時 cout<<"‖"<<"[有]性別選擇時: "<<endl; cout<<"‖"<<"預選擇性別 "<<ss_times_of_0<<" 次。"<<endl; cout<<"‖"<<"預消耗 "<<Estimated_price2_0<<" 至 "<<Estimated_price3_0<<" 之間的遊戲幣。"<<endl; // (2) 輸出普通提示 cout<<"‖"<<endl; cout<<"‖"<<"●[普通](以每一隻都是1v為基礎): "<<endl; // 輸出預估消耗 - 無性別選擇時 cout<<"‖"<<"預消耗 "<<count_of_powerlock<<" 個鎖屬性道具。"<<endl; cout<<"‖"<<"[無]性別選擇時: "<<endl; cout<<"‖"<<"預消耗 "<<Estimated_price1<<" 遊戲幣。"<<endl; // 輸出預估消耗 - 有性別選擇時 cout<<"‖"<<"[有]性別選擇時: "<<endl; cout<<"‖"<<"預選擇性別 "<<ss_times<<" 次。"<<endl; cout<<"‖"<<"預消耗 "<<Estimated_price2<<" 至 "<<Estimated_price3<<" 之間的遊戲幣。"<<endl; cout<<"====================================================="<<endl; }else if(number=1){ // 輸出預估消耗 - 無性別選擇時 cout<<"‖"<<"預估總共消耗 "<<count_of_powerlock<<" 個鎖屬性道具。"<<endl; cout<<"‖"<<"預估總共消耗 "<<Estimated_price1<<" 遊戲幣。(不需要選擇性別的情況)"<<endl; // 輸出預估消耗 - 有性別選擇時 cout<<"‖"<<"預估總共消耗 "<<Estimated_price2<<" 至 "<<Estimated_price3<<" 之間的遊戲幣。"<<endl; cout<<"====================================================="<<endl; } } return 88; } 使用教程:打开c++相关的软件,编译生成exe文件就能食用了。编程目的: 帮助新人(&懒人)预估一下孵蛋的大致成本。我使用的是:[Dev-C++ 5.11] & [TMD-GCC 4.9.2 64-bit Release] 简体效果图: 折叠 繁体效果图: 折叠 本人保证该可执行文件只具有计算功能,没有包含任何后门与病毒。 Ogata and supersoullife 1 1 Link to comment
lolicong Posted May 11, 2020 Author Share Posted May 11, 2020 (edited) 于2020/4/9 PM8点10分,2291413282 说: ??????????? 朋友你这是直接改的后缀吧?? 引用 使用教程:打开c++相关的软件,编译生成exe文件就能食用了。 Edited May 11, 2020 by lolicong Link to comment
Atlandiss Posted July 29, 2020 Share Posted July 29, 2020 (edited) 在文件的第37行有个小语法错误 这个为37行的错误 将37行的 version<< 删掉后可以正常运行,或者将整个37行给删掉也能行 还是有用的。我用的是很老的,好像是2008年版本的VC++或者是2012年版本的,进去新建一个C++程序就可以运行了。 Edited July 29, 2020 by Atlandiss Link to comment
disvgod Posted August 23, 2020 Share Posted August 23, 2020 于2020/7/30 AM1点40分,Atlandiss 说: 在文件的第37行有个小语法错误 这个为37行的错误 将37行的 version<< 删掉后可以正常运行,或者将整个37行给删掉也能行 还是有用的。我用的是很老的,好像是2008年版本的VC++或者是2012年版本的,进去新建一个C++程序就可以运行了。 把version<< 删了还是不行 Link to comment
lolicong Posted October 16, 2020 Author Share Posted October 16, 2020 于2020/7/30 AM1点40分,Atlandiss 说: 在文件的第37行有个小语法错误 这个为37行的错误 将37行的 version<< 删掉后可以正常运行,或者将整个37行给删掉也能行 还是有用的。我用的是很老的,好像是2008年版本的VC++或者是2012年版本的,进去新建一个C++程序就可以运行了。 这个可能和编译器有关,版本不一样 我这个只是用来显示当前版本的,删了完全不影响代码 Link to comment
lolicong Posted October 16, 2020 Author Share Posted October 16, 2020 于2020/8/23 AM10点20分,disvgod 说: 把version<< 删了还是不行 你看一眼最下面的提示…… Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now