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 _3
- {
- class Program
- {
- static void Main(string[] args)
- {
- int krok=0,liczba=0, suma=0;
- double średnia;
- while (krok<10)
- {
- liczba = new Random().Next(10, 21);
- krok++;
- suma += liczba;
- średnia = suma / krok;
- Console.WriteLine("Krok pętli nr {0}, podano liczbę {1}, suma: {2}, średnia: {3}" ,krok,liczba,suma,średnia);
- Console.ReadKey();
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement