Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace pozitiv_negativosszege
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Kólity Kristóf");
- int szam, poz = 0, neg = 0;
- Console.Write("Hany szamot akarsz bevinni : ");
- int n = int.Parse(Console.ReadLine());
- Console.WriteLine("Irj be " + n + " számot");
- for (int i = 1; i <= n; i++)
- {
- szam = int.Parse(Console.ReadLine());
- if (szam > 0)
- poz += szam;
- else
- neg += szam;
- }
- Console.WriteLine("A bevitt pozitiv szamok osszege : " + poz);
- Console.WriteLine("A bevitt negativ szamok osszege : " + neg);
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement