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 Zadanie1b
- {
- class Program
- {
- static void Main(string[] args)
- {
- try
- {
- Int64 liczba = 0, suma = 0, średnia = 0;
- Random r = new Random();
- for (int i = 1; i < 11; i++)
- {
- liczba = r.Next(10, 20);
- for (; liczba % 2 == 0; )
- {
- liczba = r.Next(10, 20);
- }
- suma += liczba;
- średnia = suma / i;
- Console.WriteLine("Krok pętli nr {0}, podano liczbę {1}, suma {2}, średnia {3}", i, liczba, suma, średnia);
- }
- }
- catch (Exception q)
- {
- Console.WriteLine(q.Message);
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement