Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- // Random rnd = new Random();
- // int a = rnd.Next(2, 13);
- // int b = rnd.Next(2, 13);
- // int c = rnd.Next(2, 13);
- // int d = rnd.Next(2, 13);
- // int e = rnd.Next(2, 13);
- // int f = rnd.Next(2, 13);
- //int dev = (a * e - b * d);
- // if(dev == 0)
- // {
- // Console.WriteLine("uncorrect answer");
- // }
- // else
- // {
- // int x = (c * e - b * f);
- // int y = (a * f - c * d);
- // Console.WriteLine("(" + x + ", " + y + ")");
- // }
- /****************************************************************************************/
- //Random rnd = new Random();
- //int mtrNum = rnd.Next(1, 11);
- //if(mtrNum == 1)
- //{
- // Console.WriteLine("one");
- //}
- //else if (mtrNum == 2)
- //{
- // Console.WriteLine("Two");
- //}
- //else if(mtrNum == 3){
- // Console.WriteLine("Three");
- //}
- //else if (mtrNum == 4)
- // {
- // Console.WriteLine("four");
- // }
- //else if (mtrNum == 5)
- //{
- // Console.WriteLine("five");
- //}
- //else if (mtrNum == 6)
- //{
- // Console.WriteLine("six");
- //}
- //else
- // {
- // Console.WriteLine("un correct number");
- //}
- /********************************************************************************/
- //Console.WriteLine("enter the name if the anumal deer / turtle");
- //String animalName = Console.ReadLine();
- //Console.WriteLine("the animal is :" + animalName);
- //Console.WriteLine("enter the running time for" + animalName);
- //int runSpd = int.Parse(Console.ReadLine());
- //if(animalName == "deer")
- //{
- //}
- /*******************************************************************************/
- int a, b, c;
- int root;
- Console.WriteLine("enter the value of a");
- a = int.Parse(Console.ReadLine());
- Console.WriteLine("enter the value of b");
- b = int.Parse(Console.ReadLine());
- Console.WriteLine("enter the value of c");
- c = int.Parse(Console.ReadLine());
- double delta = Math.Pow(b, 2) - 4 * a * c;
- Console.WriteLine("{0}X^2 + {1}X + {2}",a,b,c);
- if (delta< 0)
- Console.WriteLine("no solution");
- else if (delta ==0)
- {
- double solution = (double)(-b) / (2 * 1);
- Console.WriteLine("One Solution");
- Console.WriteLine("The solution is:" + solution);
- }
- else
- {
- double x1 = (double)((-b) + Math.Sqrt(delta)) / (2 * a);
- double x2 = (double)((-b) - Math.Sqrt(delta)) / (2 * a);
- Console.WriteLine("Two solution");
- Console.WriteLine("The solution is: x1:{0} , x2:{1}" ,x1 ,x2);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement