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;
- namespace novo2
- {
- class Program
- {
- static void Main(string[] args)
- {
- int firstNumber;
- firstNumber = int.Parse(Console.ReadLine());
- int secondNumber;
- secondNumber = int.Parse(Console.ReadLine());
- int thirdNumber;
- thirdNumber = int.Parse(Console.ReadLine());
- int fourthNumber;
- fourthNumber = int.Parse(Console.ReadLine());
- int fifthNumber;
- fifthNumber = int.Parse(Console.ReadLine());
- int a;
- int b;
- int c;
- int d;
- int e;
- a = firstNumber;
- b = secondNumber;
- c = thirdNumber;
- d = fourthNumber;
- e = fifthNumber;
- int def = 0;
- if (a + b == 0)
- {
- Console.WriteLine("{0} + {1} = 0", a, b);
- def = 1;
- }
- if (a + b + c == 0)
- {
- Console.WriteLine("{0} + {1} + {2} = 0", a, b, c);
- def = 1;
- }
- if (a + c == 0)
- {
- Console.WriteLine("{0} + {1} = 0", a, c);
- def = 1;
- }
- if (b + c == 0)
- {
- Console.WriteLine("{0} + {1} = 0", b, c);
- def = 1;
- }
- if (a + b + c + d == 0)
- {
- Console.WriteLine("{0} + {1} + {2} + {3} = 0", a, b, c, d);
- def = 1;
- }
- if (a + b + d == 0)
- {
- Console.WriteLine("{0} + {1} + {2} = 0", a, b, d);
- def = 1;
- }
- if (a + c + d == 0)
- {
- Console.WriteLine("{0} + {1} + {2} = 0", a, c, d);
- def = 1;
- }
- if (b + c + d == 0)
- {
- Console.WriteLine("{0} + {1} + {2} = 0", b, c, d);
- def = 1;
- }
- if (a + d == 0)
- {
- Console.WriteLine("{0} + {1} = 0", a, d);
- def = 1;
- }
- if (b + d == 0)
- {
- Console.WriteLine("{0} + {1} = 0", b, d);
- def = 1;
- }
- if (c + d == 0)
- {
- Console.WriteLine("{0} + {1} = 0", c, d);
- def = 1;
- }
- if (a + b + c + d + e == 0)
- {
- Console.WriteLine("{0} + {1} + {2} + {3} + {4} = 0", a, b, c, d, e);
- def = 1;
- }
- if (a + e + c + d == 0)
- {
- Console.WriteLine("{0} + {1} + {2} + {3} = 0", a, c, d, e);
- def = 1;
- }
- if (e + b + c + d == 0)
- {
- Console.WriteLine("{0} + {1} + {2} + {3} = 0", b, c, d, e);
- def = 1;
- }
- if (a + b + e + d == 0)
- {
- Console.WriteLine("{0} + {1} + {2} + {3} = 0", a, b, d, e);
- def = 1;
- }
- if (a + b + c + e == 0)
- {
- Console.WriteLine("{0} + {1} + {2} + {3} = 0", a, b, c, e);
- def = 1;
- }
- if (a + b + e == 0)
- {
- Console.WriteLine("{0} + {1} + {2} = 0", a, b, e);
- def = 1;
- }
- if (a + c + e == 0)
- {
- Console.WriteLine("{0} + {1} + {2} = 0", a, c, e);
- def = 1;
- }
- if (a + d + e == 0)
- {
- Console.WriteLine("{0} + {1} + {2} = 0", a, d, e);
- def = 1;
- }
- if (c + b + e == 0)
- {
- Console.WriteLine("{0} + {1} + {2} = 0", b, c, e);
- def = 1;
- }
- if (d + b + e == 0)
- {
- Console.WriteLine("{0} + {1} + {2} = 0", b, d, e);
- def = 1;
- }
- if (c + d + e == 0)
- {
- Console.WriteLine("{0} + {1} + {2} = 0", c, d, e);
- def = 1;
- }
- if (a + e == 0)
- {
- Console.WriteLine("{0} + {1} = 0", a, e);
- def = 1;
- }
- if (b + e == 0)
- {
- Console.WriteLine("{0} + {1} = 0", b, e);
- def = 1;
- }
- if (c + e == 0)
- {
- Console.WriteLine("{0} + {1} = 0", c, e);
- def = 1;
- }
- if (d + e == 0)
- {
- Console.WriteLine("{0} + {1} = 0", d, e);
- def = 1;
- }
- if ( def == 0)
- {
- Console.WriteLine("No zero subset");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment