Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace aps
- {
- public partial class Form1 : Form
- {
- private Int32 cifra(Int32 x)
- {
- int cm = x%10;
- while (x != 0)
- {
- int c = x % 10;
- if (cm < c) cm = c;
- x = x / 10;
- }
- return cm;
- }
- public Form1()
- {
- InitializeComponent();
- }
- private void b_3_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void b_2_Click(object sender, EventArgs e)
- {
- Int32 nr1 = Convert.ToInt32(tb_1.Text);
- Int32 nr2 = Convert.ToInt32(tb_2.Text);
- Int32 nr3 = Convert.ToInt32(tb_3.Text);
- int numar = cifra(nr1) * 100 + cifra(nr2) * 10 + cifra(nr3);
- tb_4.Text = Convert.ToString(numar);
- }
- private void b_1_Click(object sender, EventArgs e)
- {
- tb_1.Text = "";
- tb_2.Text = "";
- tb_3.Text = "";
- tb_4.Text = "";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement