Advertisement
Guest User

Untitled

a guest
May 20th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace Polinom_final
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void button1_Click(object sender, EventArgs e)
  21.         {
  22.             int a = Convert.ToInt32(textBox1.Text);
  23.  
  24.             // a / 1000 + a / 100 % 10 == a % 100 / 10 + a % 10;
  25.             int b = a / 1000 + a / 100 % 10;
  26.             int c = a % 100 / 10 + a % 10;
  27.  
  28.             var result = c == b ? textBox2.Text = "True" : textBox2.Text = "False";
  29.         }
  30.  
  31.         private void Form1_Load(object sender, EventArgs e)
  32.         {
  33.             //textBox1.Text = 9889.ToString();
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement