Facebook
From Silly Parrot, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 177
  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 WindowsFormsApp22
  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.             string wyraz1 = (t1.Text);
  23.             int dlugosc1 = wyraz1.Length;
  24.             string wyraz2 = (t2.Text);
  25.             int dlugosc2 = wyraz2.Length;
  26.  
  27.            
  28.  
  29.            
  30.  
  31.  
  32.             if (dlugosc1 == dlugosc2)
  33.             {
  34.                 MessageBox.Show("wyrazy są takie same");
  35.             }
  36.             else
  37.             {
  38.                 MessageBox.Show("Jeden wyraz jest " +
  39.                    "dłuszszy od drugiego o "
  40.                    + Math.Abs(dlugosc1 - dlugosc2 ) + " znaki.");
  41.             }
  42.         }
  43.            
  44.        
  45.  
  46.     }
  47. }