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;
- namespace ConsoleApplication1 {
- class Program {
- static void Main(string[] args) {
- int N, D, R;
- double S = 0;
- Random random = new Random();
- int.TryParse(args[0], out N);
- int.TryParse(args[1], out D);
- D++;
- for (int i = 0; i < N; i++) {
- R = random.Next(1, D);
- System.Console.Write("{0}\t", R);
- S += R;
- }
- System.Console.Write("Total: {0}\nAverage: {1}", S, S/N);
- System.Console.ReadKey(true);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement