Advertisement
Guest User

fun.cpp

a guest
Dec 17th, 2011
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 50.98 KB | None | 0 0
  1. #include<string>
  2. #include<algorithm>
  3. #include<string.h>
  4. #pragma once
  5.  
  6. namespace fun {
  7.  
  8.     using namespace System;
  9.     using namespace System::ComponentModel;
  10.     using namespace System::Collections;
  11.     using namespace System::Windows::Forms;
  12.     using namespace System::Data;
  13.     using namespace System::Drawing;
  14.  
  15.     /// <summary>
  16.     /// Summary for Form1
  17.     /// </summary>
  18.     public ref class Form1 : public System::Windows::Forms::Form
  19.     {
  20.     public:
  21.         Form1(void)
  22.         {
  23.             InitializeComponent();
  24.             //
  25.             //TODO: Add the constructor code here
  26.             //
  27.         }
  28.  
  29.     protected:
  30.         /// <summary>
  31.         /// Clean up any resources being used.
  32.         /// </summary>
  33.         ~Form1()
  34.         {
  35.             if (components)
  36.             {
  37.                 delete components;
  38.             }
  39.         }
  40.     private: System::Windows::Forms::Label^  label1;
  41.     private: System::Windows::Forms::Label^  label2;
  42.     private: System::Windows::Forms::Label^  label3;
  43.     private: System::Windows::Forms::Label^  label4;
  44.     private: System::Windows::Forms::Label^  label5;
  45.     private: System::Windows::Forms::Label^  label6;
  46.     private: System::Windows::Forms::Label^  label7;
  47.     private: System::Windows::Forms::Label^  label9;
  48.     private: System::Windows::Forms::Label^  label10;
  49.     private: System::Windows::Forms::Label^  label8;
  50.     private: System::Windows::Forms::Label^  label11;
  51.     private: System::Windows::Forms::Label^  label12;
  52.     private: System::Windows::Forms::Button^  button1;
  53.     private: System::Windows::Forms::Button^  button2;
  54.     private: System::Windows::Forms::Label^  label13;
  55.     private: System::Windows::Forms::Label^  label14;
  56.     private: System::Windows::Forms::Label^  label15;
  57.     private: System::Windows::Forms::Label^  label16;
  58.     private: System::Windows::Forms::Label^  label18;
  59.     private: System::Windows::Forms::Label^  label17;
  60.     private: System::Windows::Forms::Label^  label19;
  61.     private: System::Windows::Forms::Label^  label20;
  62.     private: System::Windows::Forms::Label^  label21;
  63.     private: System::Windows::Forms::TextBox^  textBox1;
  64.     private: System::Windows::Forms::TextBox^  textBox2;
  65.     private: System::Windows::Forms::TextBox^  textBox3;
  66.     private: System::Windows::Forms::TextBox^  textBox4;
  67.     private: System::Windows::Forms::TextBox^  textBox5;
  68.     private: System::Windows::Forms::TextBox^  textBox7;
  69.     private: System::Windows::Forms::TextBox^  textBox9;
  70.     private: System::Windows::Forms::TextBox^  textBox10;
  71.     private: System::Windows::Forms::TextBox^  textBox6;
  72.     private: System::Windows::Forms::TextBox^  textBox8;
  73.     private: System::Windows::Forms::TextBox^  textBox11;
  74.     private: System::Windows::Forms::TextBox^  textBox12;
  75.     private: System::Windows::Forms::TextBox^  textBox14;
  76.     private: System::Windows::Forms::TextBox^  textBox15;
  77.     private: System::Windows::Forms::TextBox^  textBox16;
  78.     private: System::Windows::Forms::TextBox^  textBox17;
  79.     private: System::Windows::Forms::TextBox^  textBox18;
  80.     private: System::Windows::Forms::Label^  label22;
  81.     private: System::Windows::Forms::Label^  label23;
  82.     private: System::Windows::Forms::Label^  label24;
  83.     private: System::Windows::Forms::TextBox^  textBox13;
  84.     private: System::Windows::Forms::TextBox^  textBox19;
  85.     private: System::Windows::Forms::Label^  label25;
  86.     private: System::Windows::Forms::Label^  label26;
  87.     private: System::Windows::Forms::Label^  label27;
  88.  
  89.     protected:
  90.  
  91.     private:
  92.         /// <summary>
  93.         /// Required designer variable.
  94.         /// </summary>
  95.         System::ComponentModel::Container ^components;
  96.  
  97. #pragma region Windows Form Designer generated code
  98.         /// <summary>
  99.         /// Required method for Designer support - do not modify
  100.         /// the contents of this method with the code editor.
  101.         /// </summary>
  102.         void InitializeComponent(void)
  103.         {
  104.         System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
  105.         this->label1 = (gcnew System::Windows::Forms::Label());
  106.         this->label2 = (gcnew System::Windows::Forms::Label());
  107.         this->label3 = (gcnew System::Windows::Forms::Label());
  108.         this->label4 = (gcnew System::Windows::Forms::Label());
  109.         this->label5 = (gcnew System::Windows::Forms::Label());
  110.         this->label6 = (gcnew System::Windows::Forms::Label());
  111.         this->label7 = (gcnew System::Windows::Forms::Label());
  112.         this->label9 = (gcnew System::Windows::Forms::Label());
  113.         this->label10 = (gcnew System::Windows::Forms::Label());
  114.         this->label8 = (gcnew System::Windows::Forms::Label());
  115.         this->label11 = (gcnew System::Windows::Forms::Label());
  116.         this->label12 = (gcnew System::Windows::Forms::Label());
  117.         this->button1 = (gcnew System::Windows::Forms::Button());
  118.         this->button2 = (gcnew System::Windows::Forms::Button());
  119.         this->label13 = (gcnew System::Windows::Forms::Label());
  120.         this->label14 = (gcnew System::Windows::Forms::Label());
  121.         this->label15 = (gcnew System::Windows::Forms::Label());
  122.         this->label16 = (gcnew System::Windows::Forms::Label());
  123.         this->label18 = (gcnew System::Windows::Forms::Label());
  124.         this->label17 = (gcnew System::Windows::Forms::Label());
  125.         this->label19 = (gcnew System::Windows::Forms::Label());
  126.         this->label20 = (gcnew System::Windows::Forms::Label());
  127.         this->label21 = (gcnew System::Windows::Forms::Label());
  128.         this->textBox1 = (gcnew System::Windows::Forms::TextBox());
  129.         this->textBox2 = (gcnew System::Windows::Forms::TextBox());
  130.         this->textBox3 = (gcnew System::Windows::Forms::TextBox());
  131.         this->textBox4 = (gcnew System::Windows::Forms::TextBox());
  132.         this->textBox5 = (gcnew System::Windows::Forms::TextBox());
  133.         this->textBox7 = (gcnew System::Windows::Forms::TextBox());
  134.         this->textBox9 = (gcnew System::Windows::Forms::TextBox());
  135.         this->textBox10 = (gcnew System::Windows::Forms::TextBox());
  136.         this->textBox6 = (gcnew System::Windows::Forms::TextBox());
  137.         this->textBox8 = (gcnew System::Windows::Forms::TextBox());
  138.         this->textBox11 = (gcnew System::Windows::Forms::TextBox());
  139.         this->textBox12 = (gcnew System::Windows::Forms::TextBox());
  140.         this->textBox14 = (gcnew System::Windows::Forms::TextBox());
  141.         this->textBox15 = (gcnew System::Windows::Forms::TextBox());
  142.         this->textBox16 = (gcnew System::Windows::Forms::TextBox());
  143.         this->textBox17 = (gcnew System::Windows::Forms::TextBox());
  144.         this->textBox18 = (gcnew System::Windows::Forms::TextBox());
  145.         this->label22 = (gcnew System::Windows::Forms::Label());
  146.         this->label23 = (gcnew System::Windows::Forms::Label());
  147.         this->label24 = (gcnew System::Windows::Forms::Label());
  148.         this->textBox13 = (gcnew System::Windows::Forms::TextBox());
  149.         this->textBox19 = (gcnew System::Windows::Forms::TextBox());
  150.         this->label25 = (gcnew System::Windows::Forms::Label());
  151.         this->label26 = (gcnew System::Windows::Forms::Label());
  152.         this->label27 = (gcnew System::Windows::Forms::Label());
  153.         this->SuspendLayout();
  154.         //
  155.         // label1
  156.         //
  157.         this->label1->AutoSize = true;
  158.         this->label1->BackColor = System::Drawing::Color::Transparent;
  159.         this->label1->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  160.             static_cast<System::Byte>(0)));
  161.         this->label1->Location = System::Drawing::Point(325, 74);
  162.         this->label1->Name = L"label1";
  163.         this->label1->Size = System::Drawing::Size(76, 19);
  164.         this->label1->TabIndex = 0;
  165.         this->label1->Text = L"Ball n\' Cup";
  166.         this->label1->Click += gcnew System::EventHandler(this, &Form1::label1_Click);
  167.         //
  168.         // label2
  169.         //
  170.         this->label2->AutoSize = true;
  171.         this->label2->BackColor = System::Drawing::Color::Transparent;
  172.         this->label2->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  173.             static_cast<System::Byte>(0)));
  174.         this->label2->Location = System::Drawing::Point(325, 96);
  175.         this->label2->Name = L"label2";
  176.         this->label2->Size = System::Drawing::Size(74, 19);
  177.         this->label2->TabIndex = 1;
  178.         this->label2->Text = L"Pogo Stick";
  179.         this->label2->Click += gcnew System::EventHandler(this, &Form1::label2_Click);
  180.         //
  181.         // label3
  182.         //
  183.         this->label3->AutoSize = true;
  184.         this->label3->BackColor = System::Drawing::Color::Transparent;
  185.         this->label3->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  186.             static_cast<System::Byte>(0)));
  187.         this->label3->Location = System::Drawing::Point(325, 117);
  188.         this->label3->Name = L"label3";
  189.         this->label3->Size = System::Drawing::Size(135, 19);
  190.         this->label3->TabIndex = 2;
  191.         this->label3->Text = L"Fall over Spring Toy";
  192.         //
  193.         // label4
  194.         //
  195.         this->label4->AutoSize = true;
  196.         this->label4->BackColor = System::Drawing::Color::Transparent;
  197.         this->label4->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  198.             static_cast<System::Byte>(0)));
  199.         this->label4->Location = System::Drawing::Point(325, 171);
  200.         this->label4->Name = L"label4";
  201.         this->label4->Size = System::Drawing::Size(91, 19);
  202.         this->label4->TabIndex = 3;
  203.         this->label4->Text = L"Wind up Toy";
  204.         //
  205.         // label5
  206.         //
  207.         this->label5->AutoSize = true;
  208.         this->label5->BackColor = System::Drawing::Color::Transparent;
  209.         this->label5->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  210.             static_cast<System::Byte>(0)));
  211.         this->label5->Location = System::Drawing::Point(325, 193);
  212.         this->label5->Name = L"label5";
  213.         this->label5->Size = System::Drawing::Size(101, 19);
  214.         this->label5->TabIndex = 4;
  215.         this->label5->Text = L"Clockwork Toy";
  216.         //
  217.         // label6
  218.         //
  219.         this->label6->AutoSize = true;
  220.         this->label6->BackColor = System::Drawing::Color::Transparent;
  221.         this->label6->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  222.             static_cast<System::Byte>(0)));
  223.         this->label6->Location = System::Drawing::Point(325, 214);
  224.         this->label6->Name = L"label6";
  225.         this->label6->Size = System::Drawing::Size(154, 19);
  226.         this->label6->TabIndex = 5;
  227.         this->label6->Text = L"Ghastly Jack in the Box";
  228.         //
  229.         // label7
  230.         //
  231.         this->label7->AutoSize = true;
  232.         this->label7->BackColor = System::Drawing::Color::Transparent;
  233.         this->label7->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  234.             static_cast<System::Byte>(0)));
  235.         this->label7->Location = System::Drawing::Point(325, 268);
  236.         this->label7->Name = L"label7";
  237.         this->label7->Size = System::Drawing::Size(63, 19);
  238.         this->label7->TabIndex = 6;
  239.         this->label7->Text = L"Tin Larry";
  240.         //
  241.         // label9
  242.         //
  243.         this->label9->AutoSize = true;
  244.         this->label9->BackColor = System::Drawing::Color::Transparent;
  245.         this->label9->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  246.             static_cast<System::Byte>(0)));
  247.         this->label9->Location = System::Drawing::Point(325, 290);
  248.         this->label9->Name = L"label9";
  249.         this->label9->Size = System::Drawing::Size(90, 19);
  250.         this->label9->TabIndex = 7;
  251.         this->label9->Text = L"Draconic Toy";
  252.         //
  253.         // label10
  254.         //
  255.         this->label10->AutoSize = true;
  256.         this->label10->BackColor = System::Drawing::Color::Transparent;
  257.         this->label10->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  258.             static_cast<System::Byte>(0)));
  259.         this->label10->Location = System::Drawing::Point(325, 311);
  260.         this->label10->Name = L"label10";
  261.         this->label10->Size = System::Drawing::Size(118, 19);
  262.         this->label10->TabIndex = 8;
  263.         this->label10->Text = L"Replica Deathbot";
  264.         //
  265.         // label8
  266.         //
  267.         this->label8->AutoSize = true;
  268.         this->label8->BackColor = System::Drawing::Color::Transparent;
  269.         this->label8->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 15.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  270.             static_cast<System::Byte>(0)));
  271.         this->label8->Location = System::Drawing::Point(287, 42);
  272.         this->label8->Name = L"label8";
  273.         this->label8->Size = System::Drawing::Size(85, 24);
  274.         this->label8->TabIndex = 9;
  275.         this->label8->Text = L"Wooden";
  276.         //
  277.         // label11
  278.         //
  279.         this->label11->AutoSize = true;
  280.         this->label11->BackColor = System::Drawing::Color::Transparent;
  281.         this->label11->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 15.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  282.             static_cast<System::Byte>(0)));
  283.         this->label11->Location = System::Drawing::Point(287, 139);
  284.         this->label11->Name = L"label11";
  285.         this->label11->Size = System::Drawing::Size(97, 24);
  286.         this->label11->TabIndex = 10;
  287.         this->label11->Text = L"Clockwork";
  288.         this->label11->Click += gcnew System::EventHandler(this, &Form1::label11_Click);
  289.         //
  290.         // label12
  291.         //
  292.         this->label12->AutoSize = true;
  293.         this->label12->BackColor = System::Drawing::Color::Transparent;
  294.         this->label12->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 15.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  295.             static_cast<System::Byte>(0)));
  296.         this->label12->Location = System::Drawing::Point(287, 236);
  297.         this->label12->Name = L"label12";
  298.         this->label12->Size = System::Drawing::Size(60, 24);
  299.         this->label12->TabIndex = 11;
  300.         this->label12->Text = L"Metal";
  301.         //
  302.         // button1
  303.         //
  304.         this->button1->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  305.             static_cast<System::Byte>(0)));
  306.         this->button1->Location = System::Drawing::Point(489, 150);
  307.         this->button1->Name = L"button1";
  308.         this->button1->Size = System::Drawing::Size(121, 41);
  309.         this->button1->TabIndex = 12;
  310.         this->button1->Text = L"Max Receipts";
  311.         this->button1->UseVisualStyleBackColor = true;
  312.         this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
  313.         //
  314.         // button2
  315.         //
  316.         this->button2->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  317.             static_cast<System::Byte>(0)));
  318.         this->button2->Location = System::Drawing::Point(489, 96);
  319.         this->button2->Name = L"button2";
  320.         this->button2->Size = System::Drawing::Size(121, 41);
  321.         this->button2->TabIndex = 13;
  322.         this->button2->Text = L"Max Ice Coins";
  323.         this->button2->UseVisualStyleBackColor = true;
  324.         this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
  325.         //
  326.         // label13
  327.         //
  328.         this->label13->AutoSize = true;
  329.         this->label13->BackColor = System::Drawing::Color::Transparent;
  330.         this->label13->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 15.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  331.             static_cast<System::Byte>(0)));
  332.         this->label13->Location = System::Drawing::Point(100, 57);
  333.         this->label13->Name = L"label13";
  334.         this->label13->Size = System::Drawing::Size(135, 24);
  335.         this->label13->TabIndex = 14;
  336.         this->label13->Text = L"Your Toy Parts";
  337.         //
  338.         // label14
  339.         //
  340.         this->label14->AutoSize = true;
  341.         this->label14->BackColor = System::Drawing::Color::Transparent;
  342.         this->label14->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  343.             static_cast<System::Byte>(0)));
  344.         this->label14->Location = System::Drawing::Point(153, 89);
  345.         this->label14->Name = L"label14";
  346.         this->label14->Size = System::Drawing::Size(50, 19);
  347.         this->label14->TabIndex = 15;
  348.         this->label14->Text = L"Wood";
  349.         //
  350.         // label15
  351.         //
  352.         this->label15->AutoSize = true;
  353.         this->label15->BackColor = System::Drawing::Color::Transparent;
  354.         this->label15->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  355.             static_cast<System::Byte>(0)));
  356.         this->label15->Location = System::Drawing::Point(153, 116);
  357.         this->label15->Name = L"label15";
  358.         this->label15->Size = System::Drawing::Size(50, 19);
  359.         this->label15->TabIndex = 16;
  360.         this->label15->Text = L"Spring";
  361.         //
  362.         // label16
  363.         //
  364.         this->label16->AutoSize = true;
  365.         this->label16->BackColor = System::Drawing::Color::Transparent;
  366.         this->label16->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  367.             static_cast<System::Byte>(0)));
  368.         this->label16->Location = System::Drawing::Point(153, 143);
  369.         this->label16->Name = L"label16";
  370.         this->label16->Size = System::Drawing::Size(47, 19);
  371.         this->label16->TabIndex = 17;
  372.         this->label16->Text = L"Screw";
  373.         //
  374.         // label18
  375.         //
  376.         this->label18->AutoSize = true;
  377.         this->label18->BackColor = System::Drawing::Color::Transparent;
  378.         this->label18->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  379.             static_cast<System::Byte>(0)));
  380.         this->label18->Location = System::Drawing::Point(153, 197);
  381.         this->label18->Name = L"label18";
  382.         this->label18->Size = System::Drawing::Size(45, 19);
  383.         this->label18->TabIndex = 19;
  384.         this->label18->Text = L"Metal";
  385.         //
  386.         // label17
  387.         //
  388.         this->label17->AutoSize = true;
  389.         this->label17->BackColor = System::Drawing::Color::Transparent;
  390.         this->label17->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  391.             static_cast<System::Byte>(0)));
  392.         this->label17->Location = System::Drawing::Point(153, 251);
  393.         this->label17->Name = L"label17";
  394.         this->label17->Size = System::Drawing::Size(92, 19);
  395.         this->label17->TabIndex = 20;
  396.         this->label17->Text = L"Ghostly Cloth";
  397.         //
  398.         // label19
  399.         //
  400.         this->label19->AutoSize = true;
  401.         this->label19->BackColor = System::Drawing::Color::Transparent;
  402.         this->label19->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  403.             static_cast<System::Byte>(0)));
  404.         this->label19->Location = System::Drawing::Point(153, 170);
  405.         this->label19->Name = L"label19";
  406.         this->label19->Size = System::Drawing::Size(36, 19);
  407.         this->label19->TabIndex = 20;
  408.         this->label19->Text = L"Cog";
  409.         //
  410.         // label20
  411.         //
  412.         this->label20->AutoSize = true;
  413.         this->label20->BackColor = System::Drawing::Color::Transparent;
  414.         this->label20->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  415.             static_cast<System::Byte>(0)));
  416.         this->label20->Location = System::Drawing::Point(153, 224);
  417.         this->label20->Name = L"label20";
  418.         this->label20->Size = System::Drawing::Size(74, 19);
  419.         this->label20->TabIndex = 21;
  420.         this->label20->Text = L"Doohickey";
  421.         //
  422.         // label21
  423.         //
  424.         this->label21->AutoSize = true;
  425.         this->label21->BackColor = System::Drawing::Color::Transparent;
  426.         this->label21->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  427.             static_cast<System::Byte>(0)));
  428.         this->label21->Location = System::Drawing::Point(153, 278);
  429.         this->label21->Name = L"label21";
  430.         this->label21->Size = System::Drawing::Size(63, 19);
  431.         this->label21->TabIndex = 22;
  432.         this->label21->Text = L"Fire Bulb";
  433.         //
  434.         // textBox1
  435.         //
  436.         this->textBox1->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  437.             static_cast<System::Byte>(0)));
  438.         this->textBox1->Location = System::Drawing::Point(127, 89);
  439.         this->textBox1->MaxLength = 2;
  440.         this->textBox1->Name = L"textBox1";
  441.         this->textBox1->Size = System::Drawing::Size(22, 22);
  442.         this->textBox1->TabIndex = 23;
  443.         this->textBox1->Text = L"0";
  444.         this->textBox1->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  445.         this->textBox1->KeyPress += gcnew System::Windows::Forms::KeyPressEventHandler(this, &Form1::textBox1_KeyPress);
  446.         //
  447.         // textBox2
  448.         //
  449.         this->textBox2->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  450.             static_cast<System::Byte>(0)));
  451.         this->textBox2->Location = System::Drawing::Point(127, 117);
  452.         this->textBox2->MaxLength = 2;
  453.         this->textBox2->Name = L"textBox2";
  454.         this->textBox2->Size = System::Drawing::Size(22, 22);
  455.         this->textBox2->TabIndex = 24;
  456.         this->textBox2->Text = L"0";
  457.         this->textBox2->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  458.         this->textBox2->TextChanged += gcnew System::EventHandler(this, &Form1::textBox2_TextChanged);
  459.         this->textBox2->KeyPress += gcnew System::Windows::Forms::KeyPressEventHandler(this, &Form1::textBox1_KeyPress);
  460.         //
  461.         // textBox3
  462.         //
  463.         this->textBox3->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  464.             static_cast<System::Byte>(0)));
  465.         this->textBox3->Location = System::Drawing::Point(127, 142);
  466.         this->textBox3->MaxLength = 2;
  467.         this->textBox3->Name = L"textBox3";
  468.         this->textBox3->Size = System::Drawing::Size(22, 22);
  469.         this->textBox3->TabIndex = 25;
  470.         this->textBox3->Text = L"0";
  471.         this->textBox3->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  472.         this->textBox3->KeyPress += gcnew System::Windows::Forms::KeyPressEventHandler(this, &Form1::textBox1_KeyPress);
  473.         //
  474.         // textBox4
  475.         //
  476.         this->textBox4->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  477.             static_cast<System::Byte>(0)));
  478.         this->textBox4->Location = System::Drawing::Point(127, 169);
  479.         this->textBox4->MaxLength = 2;
  480.         this->textBox4->Name = L"textBox4";
  481.         this->textBox4->Size = System::Drawing::Size(22, 22);
  482.         this->textBox4->TabIndex = 26;
  483.         this->textBox4->Text = L"0";
  484.         this->textBox4->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  485.         this->textBox4->KeyPress += gcnew System::Windows::Forms::KeyPressEventHandler(this, &Form1::textBox1_KeyPress);
  486.         //
  487.         // textBox5
  488.         //
  489.         this->textBox5->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  490.             static_cast<System::Byte>(0)));
  491.         this->textBox5->Location = System::Drawing::Point(127, 196);
  492.         this->textBox5->MaxLength = 2;
  493.         this->textBox5->Name = L"textBox5";
  494.         this->textBox5->Size = System::Drawing::Size(22, 22);
  495.         this->textBox5->TabIndex = 27;
  496.         this->textBox5->Text = L"0";
  497.         this->textBox5->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  498.         this->textBox5->KeyPress += gcnew System::Windows::Forms::KeyPressEventHandler(this, &Form1::textBox1_KeyPress);
  499.         //
  500.         // textBox7
  501.         //
  502.         this->textBox7->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  503.             static_cast<System::Byte>(0)));
  504.         this->textBox7->Location = System::Drawing::Point(127, 223);
  505.         this->textBox7->MaxLength = 2;
  506.         this->textBox7->Name = L"textBox7";
  507.         this->textBox7->Size = System::Drawing::Size(22, 22);
  508.         this->textBox7->TabIndex = 28;
  509.         this->textBox7->Text = L"0";
  510.         this->textBox7->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  511.         this->textBox7->KeyPress += gcnew System::Windows::Forms::KeyPressEventHandler(this, &Form1::textBox1_KeyPress);
  512.         //
  513.         // textBox9
  514.         //
  515.         this->textBox9->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  516.             static_cast<System::Byte>(0)));
  517.         this->textBox9->Location = System::Drawing::Point(127, 250);
  518.         this->textBox9->MaxLength = 2;
  519.         this->textBox9->Name = L"textBox9";
  520.         this->textBox9->Size = System::Drawing::Size(22, 22);
  521.         this->textBox9->TabIndex = 29;
  522.         this->textBox9->Text = L"0";
  523.         this->textBox9->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  524.         this->textBox9->KeyPress += gcnew System::Windows::Forms::KeyPressEventHandler(this, &Form1::textBox1_KeyPress);
  525.         //
  526.         // textBox10
  527.         //
  528.         this->textBox10->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  529.             static_cast<System::Byte>(0)));
  530.         this->textBox10->Location = System::Drawing::Point(127, 277);
  531.         this->textBox10->MaxLength = 2;
  532.         this->textBox10->Name = L"textBox10";
  533.         this->textBox10->Size = System::Drawing::Size(22, 22);
  534.         this->textBox10->TabIndex = 30;
  535.         this->textBox10->Text = L"0";
  536.         this->textBox10->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  537.         this->textBox10->KeyPress += gcnew System::Windows::Forms::KeyPressEventHandler(this, &Form1::textBox1_KeyPress);
  538.         //
  539.         // textBox6
  540.         //
  541.         this->textBox6->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  542.             static_cast<System::Byte>(0)));
  543.         this->textBox6->Location = System::Drawing::Point(299, 75);
  544.         this->textBox6->MaxLength = 2;
  545.         this->textBox6->Name = L"textBox6";
  546.         this->textBox6->ReadOnly = true;
  547.         this->textBox6->Size = System::Drawing::Size(20, 19);
  548.         this->textBox6->TabIndex = 31;
  549.         this->textBox6->Text = L"0";
  550.         this->textBox6->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  551.         //
  552.         // textBox8
  553.         //
  554.         this->textBox8->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  555.             static_cast<System::Byte>(0)));
  556.         this->textBox8->Location = System::Drawing::Point(299, 97);
  557.         this->textBox8->MaxLength = 2;
  558.         this->textBox8->Name = L"textBox8";
  559.         this->textBox8->ReadOnly = true;
  560.         this->textBox8->Size = System::Drawing::Size(20, 19);
  561.         this->textBox8->TabIndex = 32;
  562.         this->textBox8->Text = L"0";
  563.         this->textBox8->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  564.         //
  565.         // textBox11
  566.         //
  567.         this->textBox11->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  568.             static_cast<System::Byte>(0)));
  569.         this->textBox11->Location = System::Drawing::Point(299, 119);
  570.         this->textBox11->MaxLength = 2;
  571.         this->textBox11->Name = L"textBox11";
  572.         this->textBox11->ReadOnly = true;
  573.         this->textBox11->Size = System::Drawing::Size(20, 19);
  574.         this->textBox11->TabIndex = 33;
  575.         this->textBox11->Text = L"0";
  576.         this->textBox11->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  577.         //
  578.         // textBox12
  579.         //
  580.         this->textBox12->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  581.             static_cast<System::Byte>(0)));
  582.         this->textBox12->Location = System::Drawing::Point(299, 172);
  583.         this->textBox12->MaxLength = 2;
  584.         this->textBox12->Name = L"textBox12";
  585.         this->textBox12->ReadOnly = true;
  586.         this->textBox12->Size = System::Drawing::Size(20, 19);
  587.         this->textBox12->TabIndex = 34;
  588.         this->textBox12->Text = L"0";
  589.         this->textBox12->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  590.         //
  591.         // textBox14
  592.         //
  593.         this->textBox14->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  594.             static_cast<System::Byte>(0)));
  595.         this->textBox14->Location = System::Drawing::Point(299, 194);
  596.         this->textBox14->MaxLength = 2;
  597.         this->textBox14->Name = L"textBox14";
  598.         this->textBox14->ReadOnly = true;
  599.         this->textBox14->Size = System::Drawing::Size(20, 19);
  600.         this->textBox14->TabIndex = 35;
  601.         this->textBox14->Text = L"0";
  602.         this->textBox14->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  603.         //
  604.         // textBox15
  605.         //
  606.         this->textBox15->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  607.             static_cast<System::Byte>(0)));
  608.         this->textBox15->Location = System::Drawing::Point(299, 215);
  609.         this->textBox15->MaxLength = 2;
  610.         this->textBox15->Name = L"textBox15";
  611.         this->textBox15->ReadOnly = true;
  612.         this->textBox15->Size = System::Drawing::Size(20, 19);
  613.         this->textBox15->TabIndex = 36;
  614.         this->textBox15->Text = L"0";
  615.         this->textBox15->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  616.         //
  617.         // textBox16
  618.         //
  619.         this->textBox16->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  620.             static_cast<System::Byte>(0)));
  621.         this->textBox16->Location = System::Drawing::Point(299, 312);
  622.         this->textBox16->MaxLength = 2;
  623.         this->textBox16->Name = L"textBox16";
  624.         this->textBox16->ReadOnly = true;
  625.         this->textBox16->Size = System::Drawing::Size(20, 19);
  626.         this->textBox16->TabIndex = 37;
  627.         this->textBox16->Text = L"0";
  628.         this->textBox16->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  629.         //
  630.         // textBox17
  631.         //
  632.         this->textBox17->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  633.             static_cast<System::Byte>(0)));
  634.         this->textBox17->Location = System::Drawing::Point(299, 269);
  635.         this->textBox17->MaxLength = 2;
  636.         this->textBox17->Name = L"textBox17";
  637.         this->textBox17->ReadOnly = true;
  638.         this->textBox17->Size = System::Drawing::Size(20, 19);
  639.         this->textBox17->TabIndex = 37;
  640.         this->textBox17->Text = L"0";
  641.         this->textBox17->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  642.         //
  643.         // textBox18
  644.         //
  645.         this->textBox18->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  646.             static_cast<System::Byte>(0)));
  647.         this->textBox18->Location = System::Drawing::Point(299, 291);
  648.         this->textBox18->MaxLength = 2;
  649.         this->textBox18->Name = L"textBox18";
  650.         this->textBox18->ReadOnly = true;
  651.         this->textBox18->Size = System::Drawing::Size(20, 19);
  652.         this->textBox18->TabIndex = 38;
  653.         this->textBox18->Text = L"0";
  654.         this->textBox18->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  655.         //
  656.         // label22
  657.         //
  658.         this->label22->AutoSize = true;
  659.         this->label22->BackColor = System::Drawing::Color::Transparent;
  660.         this->label22->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 15.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  661.             static_cast<System::Byte>(0)));
  662.         this->label22->Location = System::Drawing::Point(495, 219);
  663.         this->label22->Name = L"label22";
  664.         this->label22->Size = System::Drawing::Size(53, 24);
  665.         this->label22->TabIndex = 39;
  666.         this->label22->Text = L"Total";
  667.         //
  668.         // label23
  669.         //
  670.         this->label23->AutoSize = true;
  671.         this->label23->BackColor = System::Drawing::Color::Transparent;
  672.         this->label23->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  673.             static_cast<System::Byte>(0)));
  674.         this->label23->Location = System::Drawing::Point(546, 252);
  675.         this->label23->Name = L"label23";
  676.         this->label23->Size = System::Drawing::Size(64, 19);
  677.         this->label23->TabIndex = 40;
  678.         this->label23->Text = L"Ice Coins";
  679.         //
  680.         // label24
  681.         //
  682.         this->label24->AutoSize = true;
  683.         this->label24->BackColor = System::Drawing::Color::Transparent;
  684.         this->label24->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  685.             static_cast<System::Byte>(0)));
  686.         this->label24->Location = System::Drawing::Point(546, 277);
  687.         this->label24->Name = L"label24";
  688.         this->label24->Size = System::Drawing::Size(60, 19);
  689.         this->label24->TabIndex = 41;
  690.         this->label24->Text = L"Receipts";
  691.         //
  692.         // textBox13
  693.         //
  694.         this->textBox13->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  695.             static_cast<System::Byte>(0)));
  696.         this->textBox13->Location = System::Drawing::Point(499, 251);
  697.         this->textBox13->MaxLength = 3;
  698.         this->textBox13->Name = L"textBox13";
  699.         this->textBox13->ReadOnly = true;
  700.         this->textBox13->Size = System::Drawing::Size(41, 22);
  701.         this->textBox13->TabIndex = 42;
  702.         this->textBox13->Text = L"0";
  703.         this->textBox13->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  704.         //
  705.         // textBox19
  706.         //
  707.         this->textBox19->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  708.             static_cast<System::Byte>(0)));
  709.         this->textBox19->Location = System::Drawing::Point(499, 273);
  710.         this->textBox19->MaxLength = 3;
  711.         this->textBox19->Name = L"textBox19";
  712.         this->textBox19->ReadOnly = true;
  713.         this->textBox19->Size = System::Drawing::Size(41, 22);
  714.         this->textBox19->TabIndex = 43;
  715.         this->textBox19->Text = L"0";
  716.         this->textBox19->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
  717.         //
  718.         // label25
  719.         //
  720.         this->label25->AutoSize = true;
  721.         this->label25->BackColor = System::Drawing::Color::Transparent;
  722.         this->label25->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 20.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  723.             static_cast<System::Byte>(0)));
  724.         this->label25->ForeColor = System::Drawing::SystemColors::ActiveCaptionText;
  725.         this->label25->Location = System::Drawing::Point(45, 9);
  726.         this->label25->Name = L"label25";
  727.         this->label25->Size = System::Drawing::Size(551, 31);
  728.         this->label25->TabIndex = 44;
  729.         this->label25->Text = L"MouseHunt Max Ice Coins and Receipts Calculator";
  730.         //
  731.         // label26
  732.         //
  733.         this->label26->AutoSize = true;
  734.         this->label26->Location = System::Drawing::Point(12, 326);
  735.         this->label26->Name = L"label26";
  736.         this->label26->Size = System::Drawing::Size(87, 14);
  737.         this->label26->TabIndex = 45;
  738.         this->label26->Text = L"Created by zeulb";
  739.         //
  740.         // label27
  741.         //
  742.         this->label27->AutoSize = true;
  743.         this->label27->Location = System::Drawing::Point(575, 326);
  744.         this->label27->Name = L"label27";
  745.         this->label27->Size = System::Drawing::Size(56, 14);
  746.         this->label27->TabIndex = 46;
  747.         this->label27->Text = L"version 0.3";
  748.         //
  749.         // Form1
  750.         //
  751.         this->AutoScaleDimensions = System::Drawing::SizeF(6, 14);
  752.         this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  753.         this->BackgroundImage = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"$this.BackgroundImage")));
  754.         this->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Stretch;
  755.         this->ClientSize = System::Drawing::Size(642, 349);
  756.         this->Controls->Add(this->label27);
  757.         this->Controls->Add(this->label26);
  758.         this->Controls->Add(this->label25);
  759.         this->Controls->Add(this->textBox19);
  760.         this->Controls->Add(this->textBox13);
  761.         this->Controls->Add(this->label24);
  762.         this->Controls->Add(this->label23);
  763.         this->Controls->Add(this->label22);
  764.         this->Controls->Add(this->textBox18);
  765.         this->Controls->Add(this->textBox17);
  766.         this->Controls->Add(this->textBox16);
  767.         this->Controls->Add(this->textBox15);
  768.         this->Controls->Add(this->textBox14);
  769.         this->Controls->Add(this->textBox12);
  770.         this->Controls->Add(this->textBox11);
  771.         this->Controls->Add(this->textBox8);
  772.         this->Controls->Add(this->textBox6);
  773.         this->Controls->Add(this->textBox10);
  774.         this->Controls->Add(this->textBox9);
  775.         this->Controls->Add(this->textBox7);
  776.         this->Controls->Add(this->textBox5);
  777.         this->Controls->Add(this->textBox4);
  778.         this->Controls->Add(this->textBox3);
  779.         this->Controls->Add(this->textBox2);
  780.         this->Controls->Add(this->textBox1);
  781.         this->Controls->Add(this->label21);
  782.         this->Controls->Add(this->label20);
  783.         this->Controls->Add(this->label19);
  784.         this->Controls->Add(this->label17);
  785.         this->Controls->Add(this->label18);
  786.         this->Controls->Add(this->label16);
  787.         this->Controls->Add(this->label15);
  788.         this->Controls->Add(this->label14);
  789.         this->Controls->Add(this->label13);
  790.         this->Controls->Add(this->button2);
  791.         this->Controls->Add(this->button1);
  792.         this->Controls->Add(this->label12);
  793.         this->Controls->Add(this->label11);
  794.         this->Controls->Add(this->label8);
  795.         this->Controls->Add(this->label10);
  796.         this->Controls->Add(this->label9);
  797.         this->Controls->Add(this->label7);
  798.         this->Controls->Add(this->label6);
  799.         this->Controls->Add(this->label5);
  800.         this->Controls->Add(this->label4);
  801.         this->Controls->Add(this->label3);
  802.         this->Controls->Add(this->label2);
  803.         this->Controls->Add(this->label1);
  804.         this->Font = (gcnew System::Drawing::Font(L"Tw Cen MT", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
  805.             static_cast<System::Byte>(0)));
  806.         this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
  807.         this->Name = L"Form1";
  808.         this->Text = L"MouseHunt Max Ice Coins and Receipts Calculator";
  809.         this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
  810.         this->ResumeLayout(false);
  811.         this->PerformLayout();
  812.  
  813.             }
  814. #pragma endregion
  815.  
  816.     private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
  817.              }
  818.     private: System::Void label1_Click(System::Object^  sender, System::EventArgs^  e) {
  819.              }
  820.     private: System::Void label2_Click(System::Object^  sender, System::EventArgs^  e) {
  821.              }
  822.            private:
  823.    void button1_Click(System::Object ^ sender,
  824.       System::EventArgs ^ e)
  825.       {
  826.        #include<algorithm>
  827.         #include<string.h>
  828.              int a[10];
  829.              int v[10] = {0,7,12,15,10,16,20,25,30,35};
  830.              int w[10] = {0,5,10,15,6,12,20,15,25,40};
  831.              int out[10]= {0,0,0,0,0,0,0,0,0,0};
  832.              int p[10][10] = {{0,0,0,0,0,0,0,0,0,0},
  833.                             {0,4,0,3,0,0,0,0,0,0},
  834.                             {0,7,8,4,0,0,0,0,0,0},
  835.                                 {0,6,10,8,0,0,0,0,0,0},
  836.                             {0,4,2,2,1,0,0,0,0,0},
  837.                             {0,6,5,6,3,0,0,0,0,0},
  838.                             {0,3,7,3,1,0,0,1,0,0},
  839.                             {0,0,8,2,2,3,0,0,0,0},
  840.                             {0,10,0,5,3,2,0,0,1,0},
  841.                             {0,9,11,8,4,4,1,0,0,0}};
  842.              int::TryParse(textBox1->Text, a[1]);
  843.              int::TryParse(textBox2->Text, a[2]);
  844.              int::TryParse(textBox3->Text, a[3]);
  845.                 int::TryParse(textBox5->Text, a[4]);
  846.                 int::TryParse(textBox4->Text, a[5]);
  847.                 int::TryParse(textBox7->Text, a[6]);
  848.                 int::TryParse(textBox9->Text, a[7]);
  849.                 int::TryParse(textBox10->Text, a[8]);
  850.                 int mins[10],jum1,jum2,jum3,jum4,jum5,jum6,jum7,jum8;
  851.                 for(int q=1; q<=9;q++)
  852.                 {
  853.                     mins[q] = 999;
  854.                     for(int r=1; r<=8;r++)
  855.                     {
  856.                         if (p[q][r] !=0)
  857.                         {
  858.                             if (mins[q] > (a[r]/p[q][r]))
  859.                             mins[q] =(a[r]/p[q][r]);
  860.                         }
  861.                     }
  862.                 }
  863.                 int maks=0,els=0;
  864.  
  865.                 for(int a1=0;a1<=mins[1];a1++)
  866.                 for(int a2=0;a2<=mins[2];a2++)
  867.                 for(int a3=0;a3<=mins[3];a3++)
  868.                 for(int a4=0;a4<=mins[4];a4++)
  869.                 for(int a5=0;a5<=mins[5];a5++)
  870.                 for(int a6=0;a6<=mins[6];a6++)
  871.                 for(int a7=0;a7<=mins[7];a7++)
  872.                 for(int a8=0;a8<=mins[8];a8++)
  873.                 for(int a9=0;a9<=mins[9];a9++)
  874.                 {
  875.                     int lala[10];
  876.                     lala[1] = a1;
  877.                     lala[2] = a2;
  878.                     lala[3] = a3;
  879.                     lala[4] = a4;
  880.                     lala[5] = a5;
  881.                     lala[6] = a6;
  882.                     lala[7] = a7;
  883.                     lala[8] = a8;
  884.                     lala[9] = a9;
  885. jum1 = 0;
  886. jum2 = 0;
  887. jum3 = 0;
  888. jum4 = 0;
  889. jum5 = 0;
  890. jum6 = 0;
  891. jum7 = 0;
  892. jum8 = 0;
  893.                     for(int uu=1; uu<=9;uu++)
  894.                     {
  895.                         jum1+=lala[uu]*p[uu][1];
  896.                         jum2+=lala[uu]*p[uu][2];
  897.                         jum3+=lala[uu]*p[uu][3];
  898.                         jum4+=lala[uu]*p[uu][4];
  899.                         jum5+=lala[uu]*p[uu][5];
  900.                         jum6+=lala[uu]*p[uu][6];
  901.                         jum7+=lala[uu]*p[uu][7];
  902.                         jum8+=lala[uu]*p[uu][8];
  903.                     }
  904.  
  905.                     if (maks < (a1*v[1]+a2*v[2]+a3*v[3]+a4*v[4]+a5*v[5]+a6*v[6]+a7*v[7]+a8*v[8]+a9*v[9]))
  906.                     {
  907.                         if ((jum1 <= a[1]) &&(jum2 <= a[2]) &&(jum3 <= a[3]) &&(jum4 <= a[4]) &&(jum5 <= a[5]) &&(jum6 <= a[6]) &&(jum7 <= a[7]) &&(jum8 <= a[8]))
  908.                         {
  909.                         out[1] = a1;
  910.                         out[2] = a2;
  911.                         out[3] = a3;
  912.                         out[4] = a4;
  913.                         out[5] = a5;
  914.                         out[6] = a6;
  915.                         out[7] = a7;
  916.                         out[8] = a8;
  917.                         out[9] = a9;
  918.                         maks = (a1*v[1]+a2*v[2]+a3*v[3]+a4*v[4]+a5*v[5]+a6*v[6]+a7*v[7]+a8*v[8]+a9*v[9]);
  919.                         els = (a1*w[1]+a2*w[2]+a3*w[3]+a4*w[4]+a5*w[5]+a6*w[6]+a7*w[7]+a8*w[8]+a9*w[9]);
  920.                         }
  921.                     }
  922.                    
  923.  
  924.  
  925.                 }
  926.  
  927.                 textBox6->Text = out[1].ToString();
  928.                 textBox8->Text = out[2].ToString();
  929.                 textBox11->Text = out[3].ToString();
  930.                 textBox12->Text = out[4].ToString();
  931.                 textBox14->Text = out[5].ToString();
  932.                 textBox15->Text = out[6].ToString();
  933.                 textBox17->Text = out[7].ToString();
  934.                 textBox18->Text = out[8].ToString();
  935.                 textBox16->Text = out[9].ToString();
  936.                 textBox19->Text = maks.ToString();
  937.                 textBox13->Text = els.ToString();
  938.    }
  939.    private:
  940.    void button2_Click(System::Object ^ sender,
  941.       System::EventArgs ^ e)
  942.    {
  943.        #include<algorithm>
  944.         #include<string.h>
  945.              int a[10];
  946.              int w[10] = {0,7,12,15,10,16,20,25,30,35};
  947.              int v[10] = {0,5,10,15,6,12,20,15,25,40};
  948.              int out[10]= {0,0,0,0,0,0,0,0,0,0};
  949.  
  950.              int p[10][10] = {{0,0,0,0,0,0,0,0,0,0},
  951.                             {0,4,0,3,0,0,0,0,0,0},
  952.                             {0,7,8,4,0,0,0,0,0,0},
  953.                                 {0,6,10,8,0,0,0,0,0,0},
  954.                             {0,4,2,2,1,0,0,0,0,0},
  955.                             {0,6,5,6,3,0,0,0,0,0},
  956.                             {0,3,7,3,1,0,0,1,0,0},
  957.                             {0,0,8,2,2,3,0,0,0,0},
  958.                             {0,10,0,5,3,2,0,0,1,0},
  959.                             {0,9,11,8,4,4,1,0,0,0}};
  960.              int::TryParse(textBox1->Text, a[1]);
  961.              int::TryParse(textBox2->Text, a[2]);
  962.              int::TryParse(textBox3->Text, a[3]);
  963.                 int::TryParse(textBox5->Text, a[4]);
  964.                 int::TryParse(textBox4->Text, a[5]);
  965.                 int::TryParse(textBox7->Text, a[6]);
  966.                 int::TryParse(textBox9->Text, a[7]);
  967.                 int::TryParse(textBox10->Text, a[8]);
  968.                 int mins[10],jum1,jum2,jum3,jum4,jum5,jum6,jum7,jum8;
  969.                 for(int q=1; q<=9;q++)
  970.                 {
  971.                     mins[q] = 999;
  972.                     for(int r=1; r<=8;r++)
  973.                     {
  974.                         if (p[q][r] !=0)
  975.                         {
  976.                             if (mins[q] > (a[r]/p[q][r]))
  977.                             mins[q] =(a[r]/p[q][r]);
  978.                         }
  979.                     }
  980.                 }
  981.                 int maks=0,els=0;
  982.  
  983.                 for(int a1=0;a1<=mins[1];a1++)
  984.                 for(int a2=0;a2<=mins[2];a2++)
  985.                 for(int a3=0;a3<=mins[3];a3++)
  986.                 for(int a4=0;a4<=mins[4];a4++)
  987.                 for(int a5=0;a5<=mins[5];a5++)
  988.                 for(int a6=0;a6<=mins[6];a6++)
  989.                 for(int a7=0;a7<=mins[7];a7++)
  990.                 for(int a8=0;a8<=mins[8];a8++)
  991.                 for(int a9=0;a9<=mins[9];a9++)
  992.                 {
  993.                     int lala[10];
  994.                     lala[1] = a1;
  995.                     lala[2] = a2;
  996.                     lala[3] = a3;
  997.                     lala[4] = a4;
  998.                     lala[5] = a5;
  999.                     lala[6] = a6;
  1000.                     lala[7] = a7;
  1001.                     lala[8] = a8;
  1002.                     lala[9] = a9;
  1003. jum1 = 0;
  1004. jum2 = 0;
  1005. jum3 = 0;
  1006. jum4 = 0;
  1007. jum5 = 0;
  1008. jum6 = 0;
  1009. jum7 = 0;
  1010. jum8 = 0;
  1011.                     for(int uu=1; uu<=9;uu++)
  1012.                     {
  1013.                         jum1+=lala[uu]*p[uu][1];
  1014.                         jum2+=lala[uu]*p[uu][2];
  1015.                         jum3+=lala[uu]*p[uu][3];
  1016.                         jum4+=lala[uu]*p[uu][4];
  1017.                         jum5+=lala[uu]*p[uu][5];
  1018.                         jum6+=lala[uu]*p[uu][6];
  1019.                         jum7+=lala[uu]*p[uu][7];
  1020.                         jum8+=lala[uu]*p[uu][8];
  1021.                     }
  1022.  
  1023.                     if (maks < (a1*v[1]+a2*v[2]+a3*v[3]+a4*v[4]+a5*v[5]+a6*v[6]+a7*v[7]+a8*v[8]+a9*v[9]))
  1024.                     {
  1025.                         if ((jum1 <= a[1]) &&(jum2 <= a[2]) &&(jum3 <= a[3]) &&(jum4 <= a[4]) &&(jum5 <= a[5]) &&(jum6 <= a[6]) &&(jum7 <= a[7]) &&(jum8 <= a[8]))
  1026.                         {
  1027.                         out[1] = a1;
  1028.                         out[2] = a2;
  1029.                         out[3] = a3;
  1030.                         out[4] = a4;
  1031.                         out[5] = a5;
  1032.                         out[6] = a6;
  1033.                         out[7] = a7;
  1034.                         out[8] = a8;
  1035.                         out[9] = a9;
  1036.                         maks = (a1*v[1]+a2*v[2]+a3*v[3]+a4*v[4]+a5*v[5]+a6*v[6]+a7*v[7]+a8*v[8]+a9*v[9]);
  1037.                         els = (a1*w[1]+a2*w[2]+a3*w[3]+a4*w[4]+a5*w[5]+a6*w[6]+a7*w[7]+a8*w[8]+a9*w[9]);
  1038.                         }
  1039.                     }
  1040.                    
  1041.  
  1042.  
  1043.                 }
  1044.  
  1045.                 textBox6->Text = out[1].ToString();
  1046.                 textBox8->Text = out[2].ToString();
  1047.                 textBox11->Text = out[3].ToString();
  1048.                 textBox12->Text = out[4].ToString();
  1049.                 textBox14->Text = out[5].ToString();
  1050.                 textBox15->Text = out[6].ToString();
  1051.                 textBox17->Text = out[7].ToString();
  1052.                 textBox18->Text = out[8].ToString();
  1053.                 textBox16->Text = out[9].ToString();
  1054.                 textBox19->Text = els.ToString();
  1055.                 textBox13->Text = maks.ToString();
  1056.    }
  1057. private: System::Void label11_Click(System::Object^  sender, System::EventArgs^  e) {}
  1058. private: System::Void textBox2_TextChanged(System::Object^  sender, System::EventArgs^  e) {
  1059.          }
  1060.  
  1061.  
  1062. private: System::Void textBox1_KeyPress(System::Object^  sender, System::Windows::Forms::KeyPressEventArgs^  e) {
  1063.           if(!Char::IsDigit(e->KeyChar) && e->KeyChar != 0x08)
  1064.     e->Handled = true;
  1065.          }
  1066.  
  1067. };
  1068. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement