Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Fractions
- {
- public class Fraction
- {
- private double _numerator;
- private double _denominator;
- public Fraction( int numerator, int denominator)
- {
- _numerator = numerator;
- if (denominator == 0) throw new ArgumentException();
- _denominator = denominator;
- }
- public double Value { get { return _numerator / _denominator; } }
- }
- internal class Program
- {
- static void Main()
- {
- var inputLine = Console.ReadLine();
- var numbFirst = int.Parse(inputLine.Split()[0]);
- var numbSecond = int.Parse(inputLine.Split()[1]);
- var test = new Fraction(numbFirst, numbSecond);
- Console.WriteLine(test.Value);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement