Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int parzyste =0 , nieparzyste = 0;
- int[] tablica = new int[10];
- for (int i=0; i < 10; i++)
- {
- Console.WriteLine("Podaj liczbę");
- tablica[i] = Convert.ToInt32(Console.ReadLine());
- }
- for (int i = 0; i < 10; i++)
- {
- if (tablica[i] % 2 == 0) parzyste += tablica[i];
- else nieparzyste += tablica[i];
- }
- Console.WriteLine("Suma liczb parzystych to : {0}", parzyste);
- Console.WriteLine("Suma liczb nieparzystych to : {0}", nieparzyste);
- Console.ReadLine();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement