Abdullahafzalkhan

Idk

Jan 17th, 2021 (edited)
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3.  
  4. using namespace std;
  5.  
  6.  
  7.  
  8. //-------------;
  9.  
  10. //-------------;
  11. void Calculator()
  12. {
  13.             int num1, num2;
  14.  
  15. char op;
  16. int result;
  17. cout << "Enter First Number: "<< endl;
  18. cin >> num1;
  19. cout << "Enter  Operator: "<< endl;
  20. cin >> op ;
  21. cout << "Enter Second Number: "<< endl;
  22. cin >> num2;
  23.  
  24. if (op == '+'){
  25.     result = num1 + num2;
  26.     }else if(op == '-'){
  27.         result = num1 - num2;
  28.     }else if(op == '/'){
  29.         result = num1 / num2;
  30.     }else if(op == '*'){
  31.         result = num1 * num2;
  32.     }else{
  33.         result = 0;
  34.     }
  35.     if (result == 0)
  36.     {
  37.  
  38.         cout << "Invalid Operator"<< endl;
  39.     }else if (result != 0){
  40.     cout << "Answer: "<< result << endl;
  41.     }
  42. }
  43. //------------------------------;
  44. //-------------;
  45. int main(int argc, char* argv[])
  46. {
  47.  
  48.     star:
  49.  
  50.     cout << "What Do You Want To Do?"<< endl;
  51.  
  52.  
  53.     cout << "Autoclicker"<< endl;
  54.     cout << "Calculator"<< endl;
  55.     string What;
  56.     cin >> What;
  57.  
  58.     if (What == "Autoclicker")
  59. {
  60.  int n = 1;
  61. int x;
  62. int y;
  63. int times;
  64. int done;
  65. int sleepy;
  66. string choice;
  67.  
  68.  
  69.  
  70.  
  71. cout<<"Autoclicker Version 1.0" << endl;
  72.     cout << "   "<< endl;
  73.  
  74.     cout << "How many times do you wish to click?"<<endl;
  75.     cout << ":";
  76.  
  77.     cin >> times;
  78.  
  79.     cout << "How much time should there be between clicks?(Milliseconds)" << endl;
  80.     cout << "(MS)";
  81.     cin >> sleepy;
  82.     done = 0;
  83.     cout << "Starting in 5 seconds..."<< endl;
  84.     Sleep(1000);
  85.     cout << "Starting in 4 seconds..."<< endl;
  86.     Sleep(1000);
  87.     cout << "Starting in 3 seconds..."<< endl;
  88.     Sleep(1000);
  89.     cout << "Starting in 2 seconds..."<< endl;
  90.     Sleep(1000);
  91.     cout << "Starting in 1 seconds..."<< endl;
  92.     Sleep(1000);
  93.  
  94.         while (done <= times)
  95.         {
  96.  
  97.  
  98.             Sleep(sleepy);
  99.             mouse_event(MOUSEEVENTF_LEFTDOWN,x,y,0,0);
  100.             mouse_event(MOUSEEVENTF_LEFTUP,x,y,0,0);
  101.             done++;
  102.         }
  103.         cout << "Autoclicker has finished." <<endl;
  104.         cout << "Again?    (y) or (n)" << endl;
  105.         cin >> choice;
  106.         if (choice == "y")
  107.         {
  108.             system("cls");
  109.         }else{
  110.         goto star;
  111.         }
  112.  
  113.         }
  114.  
  115.  
  116.     if (What == "Calculator")
  117.     {
  118.         Calculator();
  119.                 Sleep(1200);
  120.         goto star;
  121.     }
  122.  
  123. }
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
Advertisement
Add Comment
Please, Sign In to add comment