Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace task_3
- {
- class Polynomial2
- {
- public double a, b, c, x;
- public double A
- {
- set
- {
- if (!double.TryParse(Console.ReadLine(), out a))
- A = value;
- else Console.WriteLine("Неккоректные данные");
- }
- }
- public double B
- {
- set
- {
- if (!double.TryParse(Console.ReadLine(), out b))
- B = value;
- else Console.WriteLine("Неккоректные данные");
- }
- }
- public double C
- {
- set
- {
- if (!double.TryParse(Console.ReadLine(), out c))
- C = value;
- else Console.WriteLine("Неккоректные данные");
- }
- }
- public double X
- {
- set
- {
- if (!double.TryParse(Console.ReadLine(), out x))
- X = value;
- else Console.WriteLine("Неккоректные данные");
- }
- }
- /* public Polynomial2(double a, double b, double c, double x)
- {
- if (!double.TryParse(Console.ReadLine(), out a))
- {
- this.a = Console.ReadLine();
- }
- this.b = Console.ReadLine();
- this.c = Console.ReadLine();
- this.x = Console.ReadLine();
- }
- } */
- class Program
- {
- static void Main(string[] args)
- {
- Polynomial2 koef = new Polynomial2();
- Console.WriteLine(koef.a);
- Console.WriteLine(koef.b);
- Console.WriteLine(koef.c);
- Console.WriteLine(koef.x);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement