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 ConsoleApplication1
- {
- class Range
- {
- static public double number, firstNeg;
- static public bool condition;
- class Program
- {
- static void Main(string[] args)
- {
- do
- {
- number = Convert.ToDouble(Console.ReadLine());
- }
- while (number > 0);
- if (number < 0)
- {
- firstNeg = number;
- }
- else
- {
- Console.WriteLine("В последовательности нет отрицательных чисел");
- goto Labell;
- }
- do
- {
- number = Convert.ToDouble(Console.ReadLine());
- if ((number < 0) & (number == firstNeg))
- {
- condition = true;
- }
- else condition = false;
- }
- while (number != 0);
- if (condition == true)
- Console.WriteLine("В данной последовательности отрицательные числа равны");
- else Console.WriteLine("В данной последовательности отрицательные числа не равны");
- Labell:
- Console.ReadKey();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement