Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class ShowSignOfProductVersion2
- {
- static void Main()
- {
- double n;
- int countPositive = 0;
- int countNegative = 0;
- for (int i = 1; i <= 3; i++)
- {
- do
- {
- Console.Write("n = ");
- }
- while (!double.TryParse(Console.ReadLine(), out n));
- if (n > 0)
- {
- countPositive++;
- }
- else
- {
- countNegative++;
- }
- }
- if ((countNegative != 0))
- {
- if (countNegative % 2 == 0)
- {
- Console.WriteLine("+");
- }
- else
- {
- Console.WriteLine("-");
- }
- }
- else
- {
- Console.WriteLine("+");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement