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.Windows.Forms;
- namespace CrystalMeth
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- int n = int.Parse(textBox1.Text);
- if (n<-5)
- {
- string res = ((3 * n) + 2).ToString();
- textBox2.Text = String.Format("F({0}) = (3*{0}) + 2, {0}<-5{2}{1}", n, res, Environment.NewLine);
- }
- else if (n>=-5 && n<=5)
- {
- textBox2.Text = String.Format("F({0}) = 0 , {0}c[-5,5]{2}{1}",n, 0, Environment.NewLine);
- }
- else
- {
- string res = ((3 * n) - 2).ToString();
- textBox2.Text = String.Format("F({0}) = (3*{0}) - 2, {0}>5{2}{1}", n, res,Environment.NewLine);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement