This is featured post 1 title

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation test link ullamco laboris nisi ut aliquip ex ea commodo consequat.

This is featured post 2 title

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation test link ullamco laboris nisi ut aliquip ex ea commodo consequat.

This is featured post 3 title

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation test link ullamco laboris nisi ut aliquip ex ea commodo consequat.

This is featured post 4 title

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation test link ullamco laboris nisi ut aliquip ex ea commodo consequat.

This is featured post 5 title

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation test link ullamco laboris nisi ut aliquip ex ea commodo consequat.


laptrinh

 Đề 1



Đề 2: a)
 b)
Đề 3 : a)
b)

đề 4: a) console
f(x)={căn x+1 nếu x>= -1 , x+sinx nếu x <-1
b)

Đề 6 : a)console
S= 1+1/2+1/3+…+1/n
b)
đề 7 : a) console : b) tìm phần tử lớn nhất trong dãy . c) sắp xếp các phần tử trong dãy theo thứ tự tăng dần . D) tính tổng các phần tử trong dẫy
b)
Đề 8 :a) console : f(x) = {căn x-2 nếu x>= 2 và 2+e^x nếu x<2
b)
đề 11: a)

b)

đề 12: console
f(x) = {2x+1 nếu x<=0 và 2cosx – 2^x nếu 0<x<2 và căn x-2 nếu x>= 2
b)
đề 16: a) console a) nhấp n . B) hiển thị mảng theo thứ tự tang dần . C) nhấp số nguyên x từ bàn phím. Kiểm tra xem trong mảng có pt nào = x ko . D) tìm phần tử có giá trị lớn nhất trong mảng
b)

đề 17: a) console
-nhập n , - tìm phần tử lớn nhất trên mỗi hang ,-đếm số phần tử dương chẵn trong ma trân,-tính tổng các phần tử trong ma trận
b)
Đề 18 : a) -
b)
đề 20: a)
b)
MessageBox.Show("Bạn có chắc muốn thoát không?", "Error",MessageBoxButtons.YesNoCancel); Application.Exit();
Đề 1.
namespace Đề_1_bài_1
{
    class Program
    {
        static void Main(string[] args)
        {
            float x, f;
            Console.Write("Nhap x: ");
            bool kt = float.TryParse(Console.ReadLine(), out x);
            while (!kt)
            {
                Console.Write("Hay nhap lai x: ");
                kt = float.TryParse(Console.ReadLine(), out x);
            }
            if (x < 0) f = (float)Math.Sqrt(2 * x * x + 3);
            else if (x > 1) f = x + 5;
            else f = (float)Math.Pow(3, x) + (float)Math.Cos(x);
            Console.WriteLine("Gia tri ham so f voi gia tri x = {0} la: {1}", x, f);
            Console.ReadLine();
        }
    }
}
namespace Đề_1_bài_2
{
    public partial class Form1 : Form
    {
        int n;
        int[] A;
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            n = int.Parse(textBox1.Text);
            A = new int[n];
            int i = 0;
            while (i < n)
            {
                string s = Interaction.InputBox("Nhập A[" + i.ToString() + "]", "Nhập phần tử", "");
                try
                {
                    A[i] = int.Parse(s);
                    textBox2.Text += s + "   ";
                    i++;
                }
                catch
                {
                    MessageBox.Show("Dữ liệu nhập không đúng");
                }
            }
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex == 0) textBox3.Text = A.Max().ToString();
            else textBox3.Text = A.Average().ToString();
        }
    }
}

Đề 2
namespace Đề_2_bài_1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "")
            {
                listBox1.Items.Add(textBox1.Text);
                textBox1.Clear();
                textBox1.Focus();
            }
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            this.Focus();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex != -1) listBox1.Items.RemoveAt(listBox1.SelectedIndex);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex != -1)
            {
                listBox2.Items.Add(listBox1.SelectedItem);
                listBox1.Items.RemoveAt(listBox1.SelectedIndex);
            }
        }

        private void button5_Click(object sender, EventArgs e)
        {
            if (listBox2.SelectedIndex != -1)
            {
                listBox1.Items.Add(listBox2.SelectedItem);
                listBox2.Items.RemoveAt(listBox2.SelectedIndex);
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            foreach (string item in listBox1.Items)
                listBox2.Items.Add(item);
            listBox1.Items.Clear();
        }

        private void button6_Click(object sender, EventArgs e)
        {
            foreach (string item in listBox2.Items)
                listBox1.Items.Add(item);
            listBox2.Items.Clear();
        }
    }
}



namespace Đề_2_bài_2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            int n = int.Parse(textBox1.Text);
            int m = int.Parse(textBox2.Text);
            int a = n;
            int b = m;
            int c = a % b;
            while (c != 0)
            {
                a = b;
                b = c;
                c = a % b;
            }
            if (e.NewValue == CheckState.Checked)
            {
                richTextBox1.Clear();
                if (checkedListBox1.GetItemChecked(0) == true || checkedListBox1.SelectedIndex == 0) richTextBox1.Text += "UCLN =" + b.ToString() + Environment.NewLine;
                if (checkedListBox1.GetItemChecked(1) == true || checkedListBox1.SelectedIndex == 1) richTextBox1.Text += "BCNN =" + (m * n / b).ToString() + Environment.NewLine;
                if (checkedListBox1.GetItemChecked(2) == true || checkedListBox1.SelectedIndex == 2) richTextBox1.Text += "Số lớn nhất =" + Math.Max(m, n).ToString() + Environment.NewLine;
            }
            else
            {
                richTextBox1.Clear();
                if (checkedListBox1.GetItemChecked(0) == true && checkedListBox1.SelectedIndex != 0) richTextBox1.Text += "UCLN =" + b.ToString() + Environment.NewLine;
                if (checkedListBox1.GetItemChecked(1) == true && checkedListBox1.SelectedIndex != 1) richTextBox1.Text += "BCNN =" + (m * n / b).ToString() + Environment.NewLine;
                if (checkedListBox1.GetItemChecked(2) == true && checkedListBox1.SelectedIndex != 2) richTextBox1.Text += "Số lớn nhất =" + Math.Max(m, n).ToString() + Environment.NewLine;
            }
        }
    }
}

Đề 3.
namespace Đề_3_bài_1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "")
            {
                checkedListBox1.Items.Add(textBox1.Text);
                textBox1.Clear();
                textBox1.Focus();
            }
            else MessageBox.Show("Hãy nhập dữ liệu");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (checkedListBox1.SelectedIndex != -1) checkedListBox1.Items.Remove(checkedListBox1.SelectedItem);
            else MessageBox.Show("Chưa chọn học phần để xóa");
        }

        private void button3_Click(object sender, EventArgs e)
        {
            checkedListBox1.Items.Clear();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            this.Focus();
        }

        private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            if (e.NewValue == CheckState.Checked) listBox1.Items.Add(checkedListBox1.SelectedItem.ToString());
            else listBox1.Items.Remove(checkedListBox1.SelectedItem.ToString());
        }
    }
}



namespace Đề_3_bài_2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            this.Focus();
            button2.Enabled =false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            float a, b;
            bool kt1 = float.TryParse(textBox1.Text, out a);
            bool kt2 = float.TryParse(textBox2.Text, out b);
            if (kt1 && kt2)
            {
                MessageBox.Show("Dữ liệu nhập vào hợp lệ");
                button2.Enabled = true;
            }
            else
            {
                MessageBox.Show("Dữ liệu nhập vào không hợp lệ");
                if (!kt1) textBox1.Focus();
                else textBox2.Focus();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            label5.Visible = true;
            float a = float.Parse(textBox1.Text);
            float b = float.Parse(textBox2.Text);
            if (a == 0)
                if (b == 0) label5.Text = "Kết quả: Phương trình đúng với mọi x";
                else label5.Text = "Kết quả: Phương trình vô nghiệm";
            else label5.Text = "Kết quả: Phương trình có nghiệm x = " + (-b / a).ToString();
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            button2.Enabled = false;
        }
    }
}

Đề 4
namespace Đề_4_bài_1
{
    class Program
    {
        static void Main(string[] args)
        {
            float x, f;
            bool kt;
            Console.Write("Nhap x: ");
            kt = float.TryParse(Console.ReadLine(), out x);
            while (!kt)
            {
                Console.Write("Hay nhap lai x: ");
                kt = float.TryParse(Console.ReadLine(), out x);
            }
            if (x < -1) f = (float)(x + Math.Sin(x));
            else f = (float)Math.Sqrt(x + 1);
            Console.WriteLine("Gia tri cua ham so f voi x = {0} la: {1} ", x, f);
            Console.ReadLine();
        }
    }
}
namespace Đề_4_bài_2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            if (textBox1.Text != "")
            {
                try
                {
                    int n = int.Parse(textBox1.Text);
                    button1.Enabled = true;
                    button3.Enabled = true;
                }
                catch
                {
                    MessageBox.Show("Dữ liệu nhập vào không đúng", "Thông báo");
                }
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            listBox1.Items.Add(textBox1.Text);
            textBox1.Clear();
            textBox1.Focus();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex != -1) listBox1.Items.Remove(listBox1.SelectedItem);
        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex != -1) button2.Enabled = true;
            else button2.Enabled = false;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            int tong = 0;
            foreach (string item in listBox1.Items)
            {
                tong += int.Parse(item);
            }
            label2.Text = "Tổng các phần tử trong dãy là " + tong.ToString();
            label2.Visible = true;
        }

        private void button4_Click(object sender, EventArgs e)
        {
            if (DialogResult.Yes == MessageBox.Show("Bạn có chắc chắn muốn thoát","Thông báo",MessageBoxButtons.YesNo))
                this.Close();
        }
    }
}
Đề 6.
namespace Bài_1_đề_6
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            float s= 0;
            bool kt = false;
            Console.Write("Nhap n: ");
            kt = int.TryParse(Console.ReadLine(), out n);
            while (!kt)
            {
                Console.Write("Hay nhap lai n: ");
                kt = int.TryParse(Console.ReadLine(), out n);
            }
            for (int i = 1; i <= n; i++) s += (float)1 / i;
            Console.WriteLine("Gia tri bieu thuc s voi n = {0} la: {1}", n, s);
            Console.ReadLine();
        }
    }
}
namespace Bài_2_đề_6
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            this.Focus();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            float a, b;
            bool kt1 = float.TryParse(textBox1.Text, out a);
            bool kt2 = float.TryParse(textBox2.Text, out b);
            if (kt1 && kt2)
            {
                MessageBox.Show("Dữ liệu nhập vào hợp lệ");
                button2.Enabled = true;
            }
            else
            {
                button2.Enabled = false;
                MessageBox.Show("Dữ liệu nhập vào không đúng");
                if (!kt1) textBox1.Focus();
                if (!kt2) textBox2.Focus();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            int a = int.Parse(textBox1.Text);
            int b = int.Parse(textBox2.Text);
            label4.Visible = true;
            if (a == 0)
                if (b <= 0) label4.Text = "Kết quả:  Bất phương trình vô nghiệm";
                else label4.Text = "Kết quả:  Bất phương trình đúng với mọi x";
            else
            {
                float c =(float)-b / a;
                if (a > 0) label4.Text = "Kết quả:  Bất phương trình có nghiệm x >" + c.ToString();
                else label4.Text = "Kết quả:  Bất phương trình có nghiệm x <" + c.ToString();
            }
        }
    }
}

Đề 7
namespace Đề_7_bài_1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("Nhap n: ");
            int n = int.Parse(Console.ReadLine());
            int[] A = new int[n];
            for (int i = 0; i < n; i++)
            {
                Console.Write("Nhap A[{0}]:", i);
                A[i] = int.Parse(Console.ReadLine());
            }
            Console.WriteLine("Day so nguyen da nhap la:");
            for (int i = 0; i < n; i++) Console.Write("    {0}",A[i]);
            Console.WriteLine();
            Console.WriteLine("Phan tu lon nhat trong day la: {0}", A.Max());
            Array.Sort(A);
            Console.WriteLine("Mang sau khi sap xep theo thu tu tang dan la:");
            for (int i = 0; i < n; i++) Console.Write("    {0}", A[i]);
            Console.WriteLine();
            Console.WriteLine("Tong cac phan tu trong day la: {0}", A.Sum());
            Console.ReadLine();
            }
    }
}

namespace Đề_7_bài_2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            int n;
            bool kt = int.TryParse(textBox1.Text, out n);
            if (kt)
            {
                int tong = 0;
                while (n != 0)
                {
                    tong += n % 10;
                    n = n / 10;
                }
                label2.Text = "Tổng các chữ số của số của " + textBox1.Text + " là: " + tong.ToString();
            }
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            int n = int.Parse(textBox1.Text);
            float tong = 0;
            for (int i = 1; i <= n; i++)
                tong += (float)1 / i;
            if (n > 2)
                label2.Text = "1 + 1/2 + ... + 1/" + n.ToString() + "=" + tong.ToString();
            else if (n == 2) label2.Text = "1 +1/2 = 3/2";
            else if (n == 1) label2.Text = "1 = 1";
        }
    }
}

Đề 8.
namespace Đề_8_bài_1
{
    class Program
    {
        static void Main(string[] args)
        {
            float x, f;
            Console.Write("Nhap x: ");
            bool kt = float.TryParse(Console.ReadLine(), out x);
            while (!kt)
            {
                Console.Write("Nhap lai x: ");
                kt = float.TryParse(Console.ReadLine(), out x);
            }
            if (x < 2) f = 2 + (float)Math.Exp(x);
            else f = (float)Math.Sqrt(x - 2);
            Console.WriteLine("Gia tri ham so f voi x = {0} la {1}", x, f);
            Console.ReadLine();
        }
    }
}

namespace Đề_8_bài_2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                button2.Enabled = true;
                float a = float.Parse(textBox1.Text);
                float b = float.Parse(textBox2.Text);
                float c = float.Parse(textBox3.Text);
            }
            catch
            {
                MessageBox.Show("Dữ liệu nhập vào không đúng");
            }

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            this.Focus();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            float a = float.Parse(textBox1.Text);
            float b = float.Parse(textBox2.Text);
            float c = float.Parse(textBox3.Text);
            float delta = b * b - 4 * a * c;
            if (delta < 0) textBox4.Text = "Phương trình vô nghiệm";
            else if (delta == 0) textBox4.Text = "Phương trình có nghiệm kép x = " + (-b / 2 / a).ToString();
            else textBox4.Text = "Phương trình có hai nghiệm x1 =" + ((-b - Math.Sqrt(delta)) / 2 / a).ToString() + " ; x2= " + ((-b + Math.Sqrt(delta)) / 2 / a).ToString();
        }
    }
}

Đề 11.
namespace Đề_11_bài_1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            this.Focus();
            try
            {
                int n = int.Parse(textBox1.Text);
            }
            catch
            {
                MessageBox.Show("Dữ liệu nhập vào không đúng", "Nhập lại");
            }
        }

        private void groupBox1_Enter(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            int n = int.Parse(textBox1.Text);
            string[] A = new string[100];
            int tg;
            int q = int.Parse(comboBox1.SelectedItem.ToString());
            label4.Text = "Kết quả chuyển đổi số " + n.ToString() + " ở hệ 10 về hệ đếm cơ số " + q.ToString() + " là:";
            int i = 0;
            while (n != 0)
            {
                tg = n % q;
                n = n / q;
                i++;
                switch (tg)
                {
                    case 10: A[i] = "A"; break;
                    case 11: A[i] = "B"; break;
                    case 12: A[i] = "C"; break;
                    case 13: A[i] = "D"; break;
                    case 14: A[i] = "E"; break;
                    case 15: A[i] = "F"; break;
                    default: A[i] = tg.ToString(); break;
                }
            }
            for (int j = i; j >= 0; j--)
                label4.Text += A[j];

        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (DialogResult.Yes == MessageBox.Show("Bạn có thực sự muốn thoát","Thông báo",MessageBoxButtons.YesNo)) this.Close();
        }
    }
}
namespace Đề_11_bài_2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            label3.Visible = true;
            int ts = int.Parse(textBox1.Text);
            int ms = int.Parse(textBox2.Text);
            int a = ts;
            int b = ms;
            int c = a % b;
            while (c != 0)
            {
                a = b;
                b = c;
                c = a % b;
            }
            label3.Text = "Phân số sau khi rút gọn là: " + (ts / b).ToString() + "/" + (ms / b).ToString();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            label3.Visible = true;
            int ts = int.Parse(textBox1.Text);
            int ms = int.Parse(textBox2.Text);
            label3.Text = "Giá trị phân số = " + ((float)ts / ms).ToString();
        }
    }
}

Đề 12.
namespace Đề_12.Bài_1
{
    class Program
    {
        static void Main(string[] args)
        {
            float x, f;
            Console.Write("Nhap x: ");
            bool kt = float.TryParse(Console.ReadLine(),out x);
            while (!kt)
            {
                Console.Write("Nhap lai x: ");
                kt = float.TryParse(Console.ReadLine(), out x);
            }
            if (x <= 0) f = 2 * x + 1;
            else if (x >= 2) f = (float)Math.Sqrt(x - 2);
            else f = 2 * (float)Math.Cos(x) - (float)Math.Pow(2, x);
            Console.WriteLine("Gia tri ham so f voi gia tri x = {0} la: {1}", x, f);
            Console.ReadLine();
        }
    }
}

namespace Đề_12_bài_2
{
    public partial class Form1 : Form
    {
        int[] A = new int[100];
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int i = 0 ;
            if (textBox1.Text != "")
                try
                {
                    A[i] = int.Parse(textBox1.Text);
                    listBox1.Items.Add(textBox1.Text);
                    i++;
                }
                catch
                {
                    MessageBox.Show("Số nhập vào không đúng");
                }
            textBox1.Clear();
            textBox1.Focus();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            listBox2.Items.Clear();
            foreach (string item in listBox1.Items)
            {
                int n = int.Parse(item);
                bool kt = true;
                for (int i = 2; i < n / 2 + 1; i++)
                    if (n % i == 0)
                    {
                        kt = false;
                        break;
                    }
                if (kt) listBox2.Items.Add(item);
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            listBox2.Items.Clear();
            int n = listBox1.Items.Count;
            int[] A = new int[n];
            int i = 0;
            foreach (string item in listBox1.Items)
            {
                A[i] = int.Parse(item);
                i++;
            }
            Array.Sort(A);
            for (i = 0; i < n; i++)
                listBox2.Items.Add(A[i].ToString());
        }
    }
}

Đề 16.
       
namespace Đề_16_bài_1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            Console.Write("Nhap n: ");
            bool kt = int.TryParse(Console.ReadLine(), out n);
            while (!kt)
            {
                Console.Write("Nhap lai n: ");
                kt = int.TryParse(Console.ReadLine(), out n);
            }
            int[] A = new int[n];
            for (int i = 0; i < n; i++)
            {
                Console.Write("Nhap A[{0}]: ");
                A[i] = int.Parse(Console.ReadLine());
            }
            Console.WriteLine("Day so nguyen da nhap la:");
            for (int i = 0; i < n; i++)
                Console.Write("   {0}", A[i]);
            Console.WriteLine();
            Array.Sort(A);
            Console.WriteLine("Day sau khi da sap xep la:");
            for (int i = 0; i < n; i++)
                Console.Write("   {0}", A[i]);
            Console.WriteLine();
            Console.Write("Nhap x: ");
            int x = int.Parse(Console.ReadLine());
            kt = false;
            for (int i = 0; i < n; i++)
                if (A[i] == x)
                {
                    kt = true;
                    break;
                }
            if (kt) Console.WriteLine("Trong mang co phan tu bang {0}", x);
            else Console.WriteLine("Trong mang khong co phan tu nao bang {0}", x);
            Console.WriteLine("Phan tu lon nhat trong mang la: {0}",A.Max());
            Console.ReadLine();
        }
    }
}

namespace Đề_16_bài_2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            this.Focus();
            int n;
            bool kt = int.TryParse(textBox1.Text, out n);
            if (!kt) MessageBox.Show("Dữ liệu nhập vào không đúng");
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int n = int.Parse(textBox1.Text);
            richTextBox1.Clear();
            richTextBox1.Visible = true;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j <= i; j++) richTextBox1.Text += "*  ";
                richTextBox1.Text += Environment.NewLine;
            }
            richTextBox2.Clear();
            richTextBox2.Visible = true;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j <= n - i - 1; j++) richTextBox2.Text += "*  ";
                richTextBox2.Text += Environment.NewLine;
            }
            richTextBox3.Clear();
            richTextBox3.Visible = true;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n - i -1; j++) richTextBox3.Text += "   ";
                for (int j = n - i - 1; j < n; j++) richTextBox3.Text += "*  ";
                richTextBox3.Text += Environment.NewLine;
            }
            richTextBox4.Clear();
            richTextBox4.Visible = true;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0;j<i;j++) richTextBox4.Text += "   ";
                for (int j =i; j<n; j++) richTextBox4.Text += "*  ";
                richTextBox4.Text += Environment.NewLine;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (DialogResult.Yes == MessageBox.Show("Bạn có chắc chắn muốn thoát không","Thông báo",MessageBoxButtons.YesNo)) this.Close();
        }
    }
}

Đề 17.
namespace Đề_17_bài_1
{
    class Program
    {
        static void Main(string[] args)
        {
            int m = 0, n = 0;
            bool kt = false;
            while (!kt)
            {
                Console.Write("Nhap so hang cua ma tran: ");
                kt = int.TryParse(Console.ReadLine(), out n);
            }
            kt = false;
            while (!kt)
            {
                Console.Write("Nhap so cot cua ma tran: ");
                kt = int.TryParse(Console.ReadLine(), out m);
            }
            int[,] A = new int[n, m];
            for (int i = 0; i < n; i++)
                for (int j = 0; j < m; j++)
                {
                    Console.Write("Hay nhap A[{0},{1}]:", i, j);
                    A[i, j] = int.Parse(Console.ReadLine());
                }
            Console.WriteLine("Ma tran vua nhap la:");
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < m; j++) Console.Write("{0}  ", A[i, j]);
                Console.WriteLine();
            }
            for (int i = 0; i < n; i++)
            {
                int max = A[i, 0];
                for (int j = 1; j < m; j++) if (max < A[i, j]) max = A[i, j];
                Console.WriteLine("Phan tu lon nhat cua hang {0} la: {1}", i, max);

            }
            int dem = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < m; j++)
                    if (A[i, j] % 2 == 0 && A[i, j] > 0) dem++;
            Console.WriteLine("So phan tu duong chan co trong ma tran la: {0}", dem);
            int tong = 0;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < m; j++) tong += A[i, j];
            Console.WriteLine("Tong cac phan tu trong ma tran la: {0}", tong);
            Console.ReadLine();
        }
    }
}
namespace Đề_17_bài_2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            this.Focus();
            button2.Enabled = false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            float a,b;
            bool kt1 = float.TryParse(textBox1.Text, out a);
            bool kt2 = float.TryParse(textBox2.Text, out b);
            if (kt2 && kt1)
            {
                MessageBox.Show("Dữ liệu hợp lệ");
                button2.Enabled = true;
            }
            else
            {
                if (!kt1) textBox1.Focus();
                if (!kt1) textBox2.Focus();
                MessageBox.Show("Dữ liệu nhập vào không đúng");
            }
           
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            button2.Enabled = false;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            label4.Visible = true;
            int a = int.Parse(textBox1.Text);
            int b = int.Parse(textBox2.Text);
            if (a == 0) if (b <= 0) label4.Text = "Kết quả: Bất phương trình vô nghiệm";
                else label4.Text = "Kết quả: Bất phương trình đúng với mọi x";
            else if (a > 0) label4.Text = "Kết quả: Bất phương trình có nghiệm x > " + (-b / a).ToString();
            else label4.Text = "Kết quả: Bất phương trình có nghiệm x < " + (-b / a).ToString();
        }
    }
}

Đề 18.
namespace Đề_18_bài_1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int n = int.Parse(textBox1.Text);
            int q = 2;
            int i = 0;
            label3.Text = "Số nguyên " + n.ToString() + " Chuyển sang hệ nhị phân là: ";
            chuyendoi(ref n, q, ref i);
        }

        private void chuyendoi(ref int n, int q, ref int i)
        {
            string[] A = new string[100];
            int du = n % q;
            while (n != 0)
            {
                switch (du)
                {
                    case 10: A[i] = "A"; break;
                    case 11: A[i] = "B"; break;
                    case 12: A[i] = "C"; break;
                    case 13: A[i] = "D"; break;
                    case 14: A[i] = "E"; break;
                    case 15: A[i] = "F"; break;
                    default: A[i] = du.ToString(); break;
                }
                i++;
                n = n / q;
                du = n % q;
            }
            for (int j = i; j >= 0; j--) label3.Text += A[j];
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            this.Focus();
            try
            {
                int n = int.Parse(textBox1.Text);
            }
            catch
            {
                MessageBox.Show("Dữ liệu nhập vào không đúng");
                this.Focus();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            int n = int.Parse(textBox1.Text);
            int q = 16;
            int i = 0;
            label3.Text = "Số nguyên " + n.ToString() + " Chuyển sang hệ Hexa là: ";
            chuyendoi(ref n, q, ref i);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (DialogResult.Yes == MessageBox.Show("Bạn có thực sự muốn thoát không","Thông báo",MessageBoxButtons.YesNo)) this.Close();
        }
    }
}

namespace Đề_18_bài_2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            int n = int.Parse(textBox1.Text);
            int m = int.Parse(textBox2.Text);
            int sodu = n % m;
            int a = n;
            int b = m;
            while (sodu != 0)
            {
                a = b;
                b = sodu;
                sodu = a % b;
            }
            if (e.NewValue == CheckState.Checked)
            {
                richTextBox1.Clear();
                if (checkedListBox1.GetItemChecked(0) == true || checkedListBox1.SelectedIndex == 0) richTextBox1.Text += "UCLN = " + b.ToString() + Environment.NewLine;
                if (checkedListBox1.GetItemChecked(1) == true || checkedListBox1.SelectedIndex == 1) richTextBox1.Text += "Số lớn nhất = " + Math.Max(m, n).ToString() + Environment.NewLine;
            }
            else
            {
                richTextBox1.Clear();
                if (checkedListBox1.GetItemChecked(0) == true && checkedListBox1.SelectedIndex != 0) richTextBox1.Text += "UCLN = " + b.ToString() + Environment.NewLine;
                if (checkedListBox1.GetItemChecked(1) == true && checkedListBox1.SelectedIndex != 1) richTextBox1.Text += "Số lớn nhất = " + Math.Max(m, n).ToString() + Environment.NewLine;
            }

        }

      
    }
}

Đề 20.
namespace Đề_20_bài_1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            this.Focus();
            try
            {
                int n = int.Parse(textBox1.Text);
            }
            catch
            {
                MessageBox.Show("Dữ liệu nhập vào không đúng");
            }
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            try
            {
                int m = int.Parse(textBox2.Text);
            }
            catch
            {
                MessageBox.Show("Dữ liệu nhập vào không đúng");
            }
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            int n = int.Parse(textBox1.Text);
            int m = int.Parse(textBox2.Text);
            if (comboBox1.SelectedIndex == 0)
            {
                int b = timuoc(n, m);
                label4.Text = "Ước số chung lớn nhất là: " + b.ToString();
            }
            else if (comboBox1.SelectedIndex == 1)
            {
                int b = m * n / timuoc(m, n);
                label4.Text = "Bội số chung nhỏ nhất là: " + b.ToString();
            }
            else label4.Text = "Số lớn nhất là: " + Math.Max(m, n);
        }

        private static int timuoc(int n, int m)
        {
            int a = n;
            int b = m;
            int c = a % b;
            while (c != 0)
            {
                a = b;
                b = c;
                c = a % b;
            }
            return b;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (DialogResult.Yes == MessageBox.Show("Bạn có chắc chắn muốn thoát không","Thông báo",MessageBoxButtons.YesNo)) this.Close();
        }
    }
}

namespace Đề_20_bài_2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
           
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            this.Focus();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int n = int.Parse(textBox1.Text);
            int m = int.Parse(textBox2.Text);
            if (comboBox1.SelectedIndex == 0) label6.Text = (m + n).ToString();
            else if (comboBox1.SelectedIndex == 1) label6.Text = (n - m).ToString();
            else if (comboBox1.SelectedIndex == 2) label6.Text = (m * n).ToString();
            else if (comboBox1.SelectedIndex == 3) label6.Text = ((float)n / m).ToString();
            else if (comboBox1.SelectedIndex == 4) label6.Text = (Math.Pow(n, m)).ToString();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (DialogResult.Yes == MessageBox.Show("Bạn có chắc chắn muốn thoát không?", "Thông báo", MessageBoxButtons.YesNo)) this.Close();
        }
    }
}




Doubledowncasino- Iphone

Play Free Online Casino Games For Fun On DoubleDown Casino

DoubleDown Casino is the best website on the Internet for free casino games and free mobile casino games with no download or registration requirements and you can get started playing right now! With millions of players online in our free casino, you can enjoy a variety of games including over 30+ free slots, Poker, Bingo, video poker and slot tournaments and much more.

DoubleDown Casino is intended for users 21 yrs+ and does not offer “real money gambling” or an opportunity to win real money or prizes based on the outcome of play.

Playing DoubleDown Casino does not imply future success at “real money gambling".

THE BEST AND BIGGEST FREE ONLINE CASINO ON THE INTERNET IS DOUBLEDOWN

Considered the Largest Casino in the World, DoubleDown Casino serves you up all the Free Casino Games you can handle. There are many free online 'casinos' offering a single game and calling themselves a full-service casino. At DoubleDown Casino, we believe in offering you every free casino game you could play for fun! We offer over 30+ Free Slot Games, Slot Tournaments, 4 Free Video Poker Games, Free Bingo, and Free Blackjack.

HOW TO ENJOY FREE ONLINE CASINO GAMES ON DOUBLEDOWN

To enter our free online casino, simply log in with your Facebook account, or try us out as a guest first if you prefer. We'll give you all the chips you need to play free casino games simply for signing in to your account. As soon as you sign in, you're ready to get started! Every day you sign in, you'll get more chips, ensuring that you can enjoy any of our free online casino game options as much as you like. To get even more chips, invite your friends to enjoy our casino games for free too.

Experience Free Online Slots at DoubleDown Casino

DoubleDown Free Casino is proud to offer top quality Free Online Slots. We have over 30 Free Slot Machine Games to choose from: Lounge Loot Slots, Mayan Gold Slots, Skyrocket Slots, Sugar Shack Slots, Phantom Manor Slots, Thanksgiving Slots, Santa's Cottage Slots, Flamin' Cherries Slots, Miner 99'R Slots, Harvest Fun Slots, Tasty Treats Slots, Fairy Garden Slots, Nighty Nightmare Slots, Dungeons and Dragons Slots, House Slots, Spirit of Christmas Slots, Skyrocket Slots, Mayan Gold Slots, Lounge Loot Slots, Irish Shamrocks Slots, Classic Slots, European Vacation Slots, Pharaoh's Tomb Game Slots, DaVinci Diamonds Slots, Cleopatra Slots, Cats Slots, Wolf Run Slots, Gridiron Gold Slots and Free Slot Tournaments 24-7! We even show you how to win at slots with our Slots Guide. We share slot machine tips on winning at slots, slot machine strategy, and give you casino slots tips on how to beat slot machines.

Play Free Blackjack Online at DoubleDown Casino

Fancy a game of chance? We've got all the free blackjack games you can play! Played using traditional decks of 52 playing cards, the object of these casino online free games is to get three cards in your hand that total up to 21 without going over and beating the house. To learn how to play blackjack, visit our Blackjack Strategy Guide which will help novices up to experts understand the rules of blackjack, blackjack card values, and blackjack tips to win at blackjack.

Free Online Video Poker at DoubleDown Casino

We offer many variations of poker, and you can enjoy as many games as you like in our free online casino. No download is required to get started and if you need to brush up on your skills, we have a great How to Play Poker Guide. Take a glance at it to learn video poker strategy, online poker tips and make sure you know all the winning poker hands!

Enjoy Free Online Roulette at DoubleDown Casino

Roulette is a classic game of chance offered in our free play casinos. Watch the little steel ball settle into black or red or odd or even and win! There's even great roulette strategy you can learn in our How to Play Roulette Guide sharing Casino Roulette Rules, Winning Roulette Tips and even Winning Roulette Systems.

Enjoy Free Online Bingo at the DoubleDown Casino

Bingo is an old classic game of chance. Play with a maximum of 12 cards and progressive jackpots. You can even customize your game art; custom bobber, playing cards and themed rooms. Play at your rate of speed we offer 3 to accommodate all player skill levels. You can even automate or play manually when you play Bingo at the DoubleDown Casino.

Play Free Online Multi-Player Poker at DoubleDown Casino

Do you love the thrill of bluffing other players for huge pots? DoubleDown Casino offers 3 types of multi-player online poker. Test your poker skills against other players at Texas Hold'em, Pot-Limit Omaha, and 5 Card Draw. Check out our poker strategy section to learn how to win big at online poker. Join thousands of other poker players who play poker every day at DoubleDown Casino.

IBotta - Cash back every time you shop - IOS

http://clicks.bluetrackmedia.com/cclick.php?creative=124257&campaign=22700&affiliate=8171&sid=


Play Solitaire on Iphone Earn Point Receive giftcard

Download 






I don’t know about you, but in my house grocery shopping is probably one of the top expenses after the mortgage. It’s just one of those necessities of life that can’t be avoided. That’s probably why extreme couponing fascinates me. I wish I had the discipline and time to master it. But alas I’m too busy trying to help you guys avoid the crap out there and discovering new ways to get your wallets a bit fatter. With that in mind, I’ve stumbled upon a cool little app that is going to make grocery shopping rewarding and a bit cheaper for you. The app is called Ibotta (pronounced: I bought a) and in this review I’m going to show you how your smartphone is going to actually help you make money instead of sucking it away from you every month. So let’s jump into it! What is Ibotta? In an nutshell, Ibotta is a free mobile app for smartphones (Android and iPhone) that will help you earn cash every time you go shopping for groceries and now movie tickets. How To Get Paid For Grocery Shopping With Ibotta! Once you’ve signed up for the free app here, you just follow these 4 easy steps: 1. Choose Products You Plan To Buy! Before shopping, open the free ibotta app. You’ll see various Ibotta Offers in their Product Gallery after selecting a store. Browse and pick through the available list of products you may want to buy. Then complete tasks relating to your favorite brands. This could be answering a poll, liking a facebook page, sharing the product you plan to buy with a friend, etc. The more tasks you complete, the more money you’ll earn. 2. Get Your Shopping on! After choosing offers by completing tasks, your offers will be added to your Pending list. Ibotta has over 50 retailers, grocery stores and restaurants nationwide. So chances are your favorite store is on the list. So you just head to one of those participating Ibotta stores and be sure to buy some of the products you picked in step 1 and any other product you may need. 3. Confirm your purchases! Ibotta doesn’t know you from a hole in the wall. So they need to confirm that you have actually bought the products to get paid. So all you need to do is take a picture of your receipt or link and use your loyalty card at preferred stores. This will help them track your purchases so you can get that money! It usually takes 24 hours to confirm and send your money into your ibotta account. 4. Make Your Money! Once you’re confirmed you can send your earnings to your PayPal account or select gift cards from iTunes, Redbox and Starbucks. Ta Da! You just got paid for grocery shopping! If you’d like to see a video of how this works and what stores are available for your cash back, check out the bonus content below: Watch How This All Works: What stores work with the Ibotta app? ibotta list of stores Ready to get started? Sign up by clicking here now. How Do I Get Paid & When? Once you’ve earned a minimum of $10 you can cash out via paypal. Just select the “Withdraw Cash” from the main menu of the app, then select “Get My Cash” to link Ibotta to your PayPal account. Want To Make Real Money With Ibotta? Ibotta is obviously a great way to make money with something you would do anyway. But if want to want to make serious money with it like I do you need to…