Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <iomanip>
  4. #include <string>
  5. #include <cstdlib>
  6. #include <ctime>
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <time.h>
  10. #include <limits>
  11. #include <cctype>
  12. #include <cmath>
  13. #include <Windows.h>
  14.  
  15. using namespace std;
  16. void rgs();
  17. void Menu();
  18. string Login();
  19. int monsters();
  20. void loading();
  21. void edit(string user,int obexp);
  22. void qns1();
  23. void qns2();
  24. void qns3();
  25. void qns4();
  26. void qns5();
  27. void qns6();
  28. void qns7();
  29. void qns8();
  30. void qns9();
  31. void qns10();
  32. int ErrorCheck();
  33.  
  34. int ans1, cLevel, cExp;
  35. string charname, pw, user, pass;
  36. bool access;
  37.  
  38.  
  39. int main()
  40. {
  41. loading();
  42. Sleep(3000);
  43. system("CLS");
  44. Menu();
  45. system("CLS");
  46. if (ans1==1)
  47. {
  48. Login();
  49. }
  50. else if (ans1==2)
  51. {
  52. rgs();
  53. system("CLS");
  54. main();
  55. }
  56. else
  57. {
  58. cout<<"You have entered an invalid option"<<endl;
  59. Sleep(2000);
  60. system("CLS");
  61. main();
  62. }
  63. system ("pause");
  64. return 0;
  65. }
  66. string Login()
  67. {
  68. cout<<"Please enter your charater name: ";
  69. cin>>user;
  70. cout<<"Please enter your password: ";
  71. cin>>pass;
  72.  
  73. int qexp;
  74. ifstream inFile;
  75. string username, password;
  76. inFile.open("users.txt");
  77. if (inFile.is_open())
  78. {
  79. while (!inFile.eof())
  80. {
  81. inFile >>username>>password>>cLevel>>cExp;
  82. if (user==username && pass==password)
  83. {
  84. access=true;
  85. break;
  86. }
  87. }
  88. if (access)
  89. {
  90. cout<<"You have login successfully!"<<endl;
  91. cout<<"You are allowed to enter 5 battles each login~"<<endl;
  92. Sleep(2000);
  93. for (int i=0; i<5;i++)
  94. {
  95. system("CLS");
  96. cout<<"You are in a fight now. Solve this question to defeat the monster!"<<endl;
  97. qexp=monsters();
  98. cout<<endl;
  99. if (cLevel=1)
  100. {qns1();
  101. edit(user,qexp);
  102. Sleep(2000);}
  103. else if (cLevel=2)
  104. {qns2();
  105. edit(user,qexp);
  106. Sleep(2000);}
  107. else if (cLevel=3)
  108. {qns3();
  109. edit(user,qexp);
  110. Sleep(2000);}
  111. else if (cLevel=4)
  112. {qns4();
  113. edit(user,qexp);
  114. Sleep(2000);}
  115. else if (cLevel=5)
  116. {qns5();
  117. edit(user,qexp);
  118. Sleep(2000);}
  119. else if (cLevel=6)
  120. {qns6();
  121. edit(user,qexp);
  122. Sleep(2000);}
  123. else if (cLevel=7)
  124. {qns7();
  125. edit(user,qexp);
  126. Sleep(2000);}
  127. else if (cLevel=8)
  128. {qns8();
  129. edit(user,qexp);
  130. Sleep(2000);}
  131. else if (cLevel=9)
  132. {qns9();
  133. edit(user,qexp);
  134. Sleep(2000);}
  135. else
  136. {qns10();
  137. edit(user,qexp);
  138. Sleep(2000);}
  139. }
  140. }
  141. else
  142. {
  143. cout<<"You have enter the wrong username/password!"<<endl;
  144. cout<<"Please try again!"<<endl;
  145. Sleep(2000);
  146. system("CLS");
  147. Login();
  148. }
  149. }
  150. else
  151. {
  152. cout<<"Error!"<<endl;
  153. }
  154. inFile.close();
  155. return user;
  156.  
  157.  
  158. }
  159.  
  160. void Menu()
  161. {
  162. cout<<"Welcome to dungeon hunter!"<<endl;
  163. cout<<"Choose a choice below."<<endl;
  164. cout<<"1. Login"<<endl;
  165. cout<<"2. Register a new account"<<endl;
  166. cout<<"Please enter your option: ";
  167. cin>>ans1;
  168. }
  169.  
  170. void rgs()
  171. {
  172. ifstream inFile;
  173. ofstream newuser;
  174. string username, password, passwordconfirm;
  175. inFile.open("users.txt", ios::app);
  176. newuser.open("users.txt", ios::app);
  177. bool uservalid=false;
  178. while (!uservalid)
  179. {
  180. cout << "Username: ";
  181. cin >> username;
  182. cout << "Password: ";
  183. cin >> password;
  184. cout << "Confirm password: ";
  185. cin >> passwordconfirm;
  186. int m=0;
  187. int k=0;
  188. while (inFile>>user>>pass)
  189. {
  190. m++;
  191. if (username!=user)
  192. k++;
  193. }
  194. if (m==k && password==passwordconfirm)
  195. uservalid=true;
  196. else if (m!=k)
  197. cout << "There is already a user with this username." << endl;
  198. else
  199. cout << "The passwords given do not match." << endl;
  200. }
  201. newuser << username << " " << password << " 1 0" << endl;
  202. cout<<"You have successfully registered an account!"<<endl;
  203. Sleep(3000);
  204. inFile.close();
  205. newuser.close();
  206. }
  207.  
  208. int monsters()
  209. {
  210. ifstream monstersFile;
  211. int mLevel, mExpA, mExpB, mExp;
  212. srand((unsigned int)time(NULL));//initialize random number generator;
  213. string monsters[10]={"Sandton","Tentacuno","Porypix","Snorbell","Paradon","Muqueen","Maromander","Nidodash","Hitmonchop","Voltchamp"};
  214. int r = rand()%10+1; //generate a number between 1-1
  215.  
  216. monstersFile.open("monsters.txt");
  217. if(!monstersFile)
  218. cout<<"Not able to open text file\n";
  219. else
  220. {
  221. cout<<left<<setw(15)<<"Name"<<setw(15)<<"Level"<<"EXP"<<endl;
  222. while(!monstersFile.eof())
  223. {
  224. monstersFile>>mLevel>>mExpA>>mExpB;
  225. if(monstersFile.fail())
  226. {
  227. break;
  228. }
  229. else
  230. {
  231. if(cLevel==mLevel)
  232. {
  233. mExp=rand()%(mExpB-mExpA+1)+mExpA;
  234. cout<<left<<setw(15)<<monsters[r]<<setw(15)<<mLevel<<setw(15)<<mExp<<endl;
  235. }
  236.  
  237. }
  238.  
  239. }
  240.  
  241. }
  242. monstersFile.close();
  243. return mExp;
  244. }
  245.  
  246. void loading()
  247. {
  248. cout<<"Welcome to dungeon ma(th)ster!"<<endl;
  249. cout << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)255 << (char)255 << (char)255 << (char) 255<< (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << endl;
  250. cout << (char)178 << (char)178 << (char)178 << (char)255 << (char)255 << (char)178 << (char)178 << (char)178 << (char)178 << (char)255 << (char)255 << (char)178 << (char)178 << (char)178 << endl;
  251. cout << (char)178 << (char)178 << (char)255 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)255 << (char)178 << (char)178 << endl;
  252. cout << (char)178 << (char)255 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)255 << (char)178 << endl;
  253. cout << (char)178 << (char)255 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)255 << (char)178 << endl;
  254. cout << (char)255 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)255 << (char)255 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)255 << endl;
  255. cout << (char)255 << (char)178 << (char)178 << (char)178 << (char)178 << (char)255 << (char)178 << (char)178 << (char)255 << (char)178 << (char)178 << (char)178 << (char)178 << (char)255 << endl;
  256. cout << (char)255 << (char)255 << (char)255 << (char)255 << (char)255 << (char)255 << (char)178 << (char)178 << (char)255 << (char)255 << (char)255 << (char)255 << (char)255 << (char)255 << endl;
  257. cout << (char)255 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)255 << (char)255 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)255 << endl;
  258. cout << (char)178 << (char)255 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)255 << (char)178 << endl;
  259. cout << (char)178 << (char)255 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)255 << (char)178 << endl;
  260. cout << (char)178 << (char)178 << (char)255 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)255 << (char)178 << (char)178 << endl;
  261. cout << (char)178 << (char)178 << (char)178 << (char)255 << (char)255 << (char)178 << (char)178 << (char)178 << (char)178 << (char)255 << (char)255 << (char)178 << (char)178 << (char)178 << endl;
  262. cout << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << (char)255 << (char)255 << (char)255 << (char)255 << (char)178 << (char)178 << (char)178 << (char)178 << (char)178 << endl;
  263.  
  264. }
  265.  
  266. void edit(string user,int obexp)
  267. {
  268. string username,pass,search;
  269. int lvl,nlvl, exp, nexp, mExp;
  270. ifstream ifile ("users.txt");
  271. ofstream ofile ("users2.txt");
  272. while (!ifile.eof())
  273. {
  274. ifile>>username>>pass>>lvl>>exp;
  275. nexp=exp+obexp;
  276. if(user==username)
  277. {
  278. if (nexp>0)
  279. {nlvl=1;}
  280. else if (nexp<1500)
  281. {nlvl=2;}
  282. else if (nexp<2200)
  283. {nlvl=3;}
  284. else if (nexp<3300)
  285. {nlvl=4;}
  286. else if (nexp<4500)
  287. {nlvl=5;}
  288. else if (nexp<6500)
  289. {nlvl=6;}
  290. else if (nexp<8700)
  291. {nlvl=7;}
  292. else if (nexp<8700)
  293. {nlvl=8;}
  294. else if (nexp<11200)
  295. {nlvl=9;}
  296. else if (nexp<14200)
  297. {nlvl=10;}
  298. else
  299. {nlvl=lvl;}
  300.  
  301. ofile<<endl<<user<<" "<<pass<<" "<<nlvl<<" "<<nexp;
  302. }
  303. else
  304. {
  305. ofile<<endl<<user<<" "<<pass<<" "<<lvl<<" "<<exp;
  306. }
  307. cout<<"\r";
  308. ifile.close();
  309. ofile.close();
  310. remove("users.txt");
  311. int result=rename("users2.txt","users.txt");
  312. if (result==0)
  313. cout<<"File successfully renamed\n";
  314. else
  315. {
  316. while (result==0)
  317. {
  318. cout<<"Error renaming file, Retrying\n";
  319. result=rename("users2.txt","users.txt");
  320. }
  321. }
  322. }
  323. }
  324.  
  325. void qns1() // plus
  326. {
  327. srand (time(NULL));
  328. int qn1 = rand() % 200 + 1;
  329. int qn2 = rand() % 100 + 1;
  330. int input;
  331. int qnsans;
  332. cout<<"Here is your question!"<<endl;
  333. cout<< qn1 <<"+"<< qn2<<endl;
  334. qnsans=qn1+qn2;
  335. bool Restart=true;
  336. while(Restart==true)
  337. {
  338. cout<<"Enter your answer : ";
  339. cin>>input;
  340. Restart = cin.fail();
  341. if(cin.fail()==true)
  342. cout<<"\nError, Invalid Choice, Please Key in a Numerical Value\n";
  343. else if(qnsans==input)// if no error is present
  344. {
  345. cout<<"You Won the round!"<<endl;
  346. Restart = false; // to allow do loop to end
  347. }
  348. else if(qnsans!=input)
  349. {
  350. cout<<"try again"<<endl;
  351. Restart = true;
  352. }
  353. else
  354. {
  355. cout<<"try again"<<endl;
  356. Restart = true;
  357. }
  358. cin.clear(); //Restart error flag
  359. }
  360.  
  361. }
  362. //plus
  363. void qns2() //minus
  364. {
  365. srand (time(NULL));
  366. int qn1 = rand() % 100 + 1;
  367. int qn2 = rand() % 100 + 1;
  368. int input;
  369. int qnsans;
  370. cout<<"Here is your question!"<<endl;
  371. cout<< qn1 <<"-"<< qn2<<endl;
  372. qnsans= qn1-qn2;
  373. bool Restart=true;
  374. while(Restart==true)
  375. {
  376. cout<<"Enter your answer : ";
  377. cin>>input;
  378. Restart = cin.fail();
  379. if(cin.fail()==true)
  380. cout<<"\nError, Invalid Choice, Please Key in a Numerical Value\n";
  381. else if(qnsans==input)// if no error is present
  382. {
  383. cout<<"You Won the round!"<<endl;
  384. Restart = false; // to allow do loop to end
  385. system("Pause");
  386. }
  387. else if(qnsans!=input)
  388. {
  389. cout<<"try again"<<endl;
  390. Restart = true;
  391. }
  392. else
  393. {
  394. cout<<"try again"<<endl;
  395. Restart = true;
  396. }
  397. cin.clear(); //Restart error flag
  398. }
  399.  
  400. } // minus
  401. //minus
  402. void qns3()//times
  403. {
  404. srand (time(NULL));
  405. int qn1 = rand() % 20 + 1;
  406. int qn2 = rand() % 10 + 1;
  407. int input;
  408. int qnsans;
  409. cout<<"Here is your question!"<<endl;
  410. cout<< qn1 <<"*"<< qn2<<endl;
  411. qnsans= qn1*qn2;
  412. bool Restart=true;
  413. while(Restart==true)
  414. {
  415. cout<<"Enter your answer : ";
  416. cin>>input;
  417. Restart = cin.fail();
  418. if(cin.fail()==true)
  419. cout<<"\nError, Invalid Choice, Please Key in a Numerical Value\n";
  420. else if(qnsans==input)// if no error is present
  421. {
  422. cout<<"You Won the round!"<<endl;
  423. Restart = false; // to allow do loop to end
  424. system("Pause");
  425. }
  426. else if(qnsans!=input)
  427. {
  428. cout<<"try again"<<endl;
  429. Restart = true;
  430. }
  431. else
  432. {
  433. cout<<"try again"<<endl;
  434. Restart = true;
  435. }
  436. cin.clear(); //Restart error flag
  437. }
  438.  
  439. }
  440. //times
  441. void qns4()//plusplus
  442. {
  443. srand (time(NULL));
  444. double qn1 = rand() % 200 + 1;
  445. double qn2 = rand() % 100 + 1;
  446. double QN3 = rand()%100+1;
  447. double input;
  448. double qnsans;
  449. cout<<"Here is your question!"<<endl;
  450. cout<< qn1 <<"+"<< qn2<<"+"<<QN3<<endl;
  451. qnsans= qn1+qn2+QN3;
  452. bool Restart=true;
  453. while(Restart==true)
  454. {
  455. cout<<"Enter your answer : ";
  456. cin>>input;
  457. Restart = cin.fail();
  458. if(cin.fail()==true)
  459. cout<<"\nError, Invalid Choice, Please Key in a Numerical Value\n";
  460. else if(qnsans==input)// if no error is present
  461. {
  462. cout<<"You Won the round!"<<endl;
  463. Restart = false; // to allow do loop to end
  464. system("Pause");
  465. }
  466. else if(qnsans!=input)
  467. {
  468. cout<<"try again"<<endl;
  469. Restart = true;
  470. }
  471. else
  472. {
  473. cout<<"try again"<<endl;
  474. Restart = true;
  475. }
  476. cin.clear(); //Restart error flag
  477. }
  478.  
  479. }
  480. //plusplus
  481. void qns5()
  482. {
  483. srand (time(NULL));
  484. double qn1 = rand() %200 + 1;
  485. double qn2 = rand() % 100 + 1;
  486. double QN3 = rand()%100+1;
  487. double input;
  488. double qnsans;
  489. cout<<"Here is your question!"<<endl;
  490. cout<< qn1 <<"-"<< qn2<<"+"<<QN3<<endl;
  491. qnsans= qn1-qn2+QN3;
  492. bool Restart=true;
  493. while(Restart==true)
  494. {
  495. cout<<"Enter your answer : ";
  496. cin>>input;
  497. Restart = cin.fail();
  498. if(cin.fail()==true)
  499. cout<<"\nError, Invalid Choice, Please Key in a Numerical Value\n";
  500. else if(qnsans==input)// if no error is present
  501. {
  502. cout<<"You Won the round!"<<endl;
  503. Restart = false; // to allow do loop to end
  504. system("Pause");
  505. }
  506. else if(qnsans!=input)
  507. {
  508. cout<<"try again"<<endl;
  509. Restart = true;
  510. }
  511. else
  512. {
  513. cout<<"try again"<<endl;
  514. Restart = true;
  515. }
  516. cin.clear(); //Restart error flag
  517. }
  518.  
  519. }
  520. //minusplus
  521. void qns6()
  522. {
  523. srand (time(NULL));
  524. double qn1 = rand() % 200 + 1;
  525. double qn2 = rand() % 20 + 1;
  526. double QN3 = rand() % 10+1;
  527. double input;
  528. double qnsans;
  529. cout<<"Here is your question!"<<endl;
  530. cout<< qn1 <<"+"<< qn2<<"*"<<QN3<<endl;
  531. qnsans= qn1+(qn2*QN3);
  532. bool Restart=true;
  533. while(Restart==true)
  534. {
  535. cout<<"Enter your answer : ";
  536. cin>>input;
  537. Restart = cin.fail();
  538. if(cin.fail()==true)
  539. cout<<"\nError, Invalid Choice, Please Key in a Numerical Value\n";
  540. else if(qnsans==input)// if no error is present
  541. {
  542. cout<<"You Won the round!"<<endl;
  543. Restart = false; // to allow do loop to end
  544. system("Pause");
  545. }
  546. else if(qnsans!=input)
  547. {
  548. cout<<"try again"<<endl;
  549. Restart = true;
  550. }
  551. else
  552. {
  553. cout<<"try again"<<endl;
  554. Restart = true;
  555. }
  556. cin.clear(); //Restart error flag
  557. }
  558.  
  559. }
  560. //plus times
  561. void qns7()
  562. {
  563. srand (time(NULL));
  564. double qn1 = rand() % 200 + 1;
  565. double qn2 = rand() % 20 + 1;
  566. double QN3 = rand() % 10+1;
  567. double input;
  568. double qnsans;
  569. cout<<"Here is your question!"<<endl;
  570. cout<< qn1 <<"-"<< qn2<<"*"<<QN3<<endl;
  571. qnsans= qn1-(qn2*QN3);
  572. bool Restart=true;
  573. while(Restart==true)
  574. {
  575. cout<<"Enter your answer : ";
  576. cin>>input;
  577. Restart = cin.fail();
  578. if(cin.fail()==true)
  579. cout<<"\nError, Invalid Choice, Please Key in a Numerical Value\n";
  580. else if(qnsans==input)// if no error is present
  581. {
  582. cout<<"You Won the round!"<<endl;
  583. Restart = false; // to allow do loop to end
  584. system("Pause");
  585. }
  586. else if(qnsans!=input)
  587. {
  588. cout<<"try again"<<endl;
  589. Restart = true;
  590. }
  591. else
  592. {
  593. cout<<"try again"<<endl;
  594. Restart = true;
  595. }
  596. cin.clear(); //Restart error flag
  597. }
  598.  
  599. }
  600. //minus times
  601. void qns8()
  602. {
  603. srand (time(NULL));
  604. double qn1 = rand() % 200 + 1;
  605. double qn2 = rand() % 30 + 1;
  606. double QN3 = rand() % 10+1;
  607. double QN4 = rand() % 10+1;
  608. double input;
  609. double qnsans;
  610. cout<<"Here is your question!"<<endl;
  611. cout<< qn1 <<"+"<< qn2<<"*"<<QN3<<"-"<<QN4<<endl;
  612. qnsans= qn1+qn2*QN3-QN4;
  613. bool Restart=true;
  614. while(Restart==true)
  615. {
  616. cout<<"Enter your answer : ";
  617. cin>>input;
  618. Restart = cin.fail();
  619. if(cin.fail()==true)
  620. cout<<"\nError, Invalid Choice, Please Key in a Numerical Value\n";
  621. else if(qnsans==input)// if no error is present
  622. {
  623. cout<<"You Won the round!"<<endl;
  624. Restart = false; // to allow do loop to end
  625. system("Pause");
  626. }
  627. else if(qnsans!=input)
  628. {
  629. cout<<"try again"<<endl;
  630. Restart = true;
  631. }
  632. else
  633. {
  634. cout<<"try again"<<endl;
  635. Restart = true;
  636. }
  637. cin.clear(); //Restart error flag
  638. }
  639.  
  640. }
  641. //plus times minus
  642. void qns9()
  643. {
  644. srand (time(NULL));
  645. double qn1 = rand() % 50 + 1;
  646. double qn2 = rand() % 20 + 1;
  647. double QN3 = rand() % 10+1;
  648. double QN4 = rand() % 10+1;
  649. double input;
  650. double qnsans;
  651. cout<<"Here is your question!"<<endl;
  652. cout<< qn1 <<"+"<< qn2<<"*"<<QN3<<"*"<<QN4<<endl;
  653. qnsans= qn1+qn2*QN3*QN4;
  654. bool Restart=true;
  655. while(Restart==true)
  656. {
  657. cout<<"Enter your answer : ";
  658. cin>>input;
  659. Restart = cin.fail();
  660. if(cin.fail()==true)
  661. cout<<"\nError, Invalid Choice, Please Key in a Numerical Value\n";
  662. else if(qnsans==input)// if no error is present
  663. {
  664. cout<<"You Won the round!"<<endl;
  665. Restart = false; // to allow do loop to end
  666. system("Pause");
  667. }
  668. else if(qnsans!=input)
  669. {
  670. cout<<"try again"<<endl;
  671. Restart = true;
  672. }
  673. else
  674. {
  675. cout<<"try again"<<endl;
  676. Restart = true;
  677. }
  678. cin.clear(); //Restart error flag
  679. }
  680.  
  681. }
  682. //plus timestimes
  683. void qns10()
  684. {
  685. srand (time(NULL));
  686. double qn1 = rand() % 200 + 1;
  687. double qn2 = rand() % 20 + 1;
  688. double QN3 = rand() % 10+1;
  689. double QN4 = rand() % 20+1;
  690. double QN5 = rand() % 20+1;
  691. double input;
  692. double qnsans;
  693. cout<<"Here is your question!"<<endl;
  694. cout<< "("<<qn1 <<"-"<< qn2<<")"<<"*"<<QN3<<"*"<<QN4<<"+"<<QN5<<endl;
  695. qnsans= (qn1-qn2)*QN3*QN4+QN5;
  696. bool Restart=true;
  697. while(Restart==true)
  698. {
  699. cout<<"Enter your answer : ";
  700. cin>>input;
  701. Restart = cin.fail();
  702. if(cin.fail()==true)
  703. cout<<"\nError, Invalid Choice, Please Key in a Numerical Value\n";
  704. else if(qnsans==input)// if no error is present
  705. {
  706. cout<<"You Won the round!"<<endl;
  707. Restart = false; // to allow do loop to end
  708. system("Pause");
  709. }
  710. else if(qnsans!=input)
  711. {
  712. cout<<"try again"<<endl;
  713. Restart = true;
  714. }
  715. else
  716. {
  717. cout<<"try again"<<endl;
  718. Restart = true;
  719. }
  720. cin.clear(); //Restart error flag
  721. }
  722.  
  723. }
  724. //(minus times) times plus
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement