Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Оператори и изрази///////////////////////////////////////////////////////////////////////////////////////////////////////////////
- using System;
- 2
- 5 problem IsThirdDigit7
- 3 class IsThirdDigit7
- 4 {
- 5 //Write an expression that checks for given integer if its third digit from right-to-left is 7.
- 6 static void Main(string[] args)
- 7 {
- 8 Console.WriteLine("Enter an integer number:");
- 9 int number = int.Parse(Console.ReadLine());
- 10 int pathToDigit = number / 100;
- 11 int thirdDigit = pathToDigit % 10;
- 12 bool isSeven = thirdDigit == 7;
- 13 Console.WriteLine("Is the third digit 7?\n" + isSeven);
- 14 }
- 15 }
- 7 point in a circle
- using System;
- 2
- 3 class PointInACircle
- 4 {
- 5 //Write an expression that checks if given point (x, y) is inside a circle K({0, 0}, 2).
- 6 static void Main(string[] args)
- 7 {
- 8 Console.WriteLine("Enter coordinate x of the point");
- 9 decimal pointX = decimal.Parse(Console.ReadLine());
- 10 Console.WriteLine("Enter coordinate y of the point");
- 11 decimal pointY = decimal.Parse(Console.ReadLine());
- 12 byte radius = 2;
- 13 //Pythagorean Theorem a^2 + b^2 = c^2 ==> (x*x) + (y*y) <= radius * radius.
- 14 //Operator * is faster than Math.Pow()
- 15 bool isInCircle = pointX * pointX + pointY * pointY <= radius * radius;
- 16 Console.WriteLine("Is the given point in the circle?\n{0}", isInCircle);
- 17 }
- 18 }
- 8 prime number chek
- using System;
- 2
- 3 class PrimeNumberCheck
- 4 {
- 5 //Write an expression that checks if given positive integer number n (n ≤ 100) is prime (i.e. it is divisible without
- 6 //remainder only to itself and 1).
- 7 static void Main(string[] args)
- 8 {
- 9 Console.WriteLine("Enter positive integer number n between 2 and 100");
- 10 int numberN = int.Parse(Console.ReadLine());
- 11 while (numberN < 2 || numberN > 100)
- 12 {
- 13 Console.WriteLine("Try again");
- 14 numberN = int.Parse(Console.ReadLine());
- 15 }
- 16 bool isPrime = true;
- 17 int counter = 1;
- 18 //Trial division
- 19 while (counter <= Math.Sqrt(numberN))
- 20 {
- 21 if (numberN % counter == 0 && counter > 1)
- 22 {
- 23 isPrime = false;
- 24 }
- 25 counter++;
- 26 }
- 27 Console.WriteLine("Is your number prime?\n{0}", isPrime);
- 28 }
- 29 }
- 10 10.InsideCircleOutsideRectangle
- using System;
- 2
- 3 class InsideCircleOutsideRectangle
- 4 {
- 5 //Write an expression that checks for given point (x, y) if it is within the circle K({1, 1}, 1.5) and out of the rectangle
- 6 //R(top=1, left=-1, width=6, height=2).
- 7 static void Main(string[] args)
- 8 {
- 9 Console.WriteLine("Enter coordinate x of the point");
- 10 decimal pointX = decimal.Parse(Console.ReadLine());
- 11 Console.WriteLine("Enter coordinate y of the point");
- 12 decimal pointY = decimal.Parse(Console.ReadLine());
- 13 decimal radius = 1.5m;
- 14 //Pythagorean Theorem a^2 + b^2 = c^2 ==> (x*x) + (y*y) <= radius * radius.
- 15 //Operator * is faster than Math.Pow()
- 16 bool isInCircle = (pointX - 1) * (pointX - 1) + (pointY - 1) * (pointY - 1) <= radius * radius;
- 17 //Every y below 1 is in the rectangle or outside the circle, or both.
- 18 if (isInCircle && pointY > 1)
- 19 {
- 20 Console.WriteLine("YES");
- 21 }
- 22 else
- 23 {
- 24 Console.WriteLine("NO");
- 25 }
- 26 }
- 27 }
- C# Homework: Console Input / Output 1-11/////////////////////////////////////////////////////////////////////////////////////////////////////
- 8 Problem 8. Numbers from 1 to n
- 3.class NumberFromOneToN
- 4.{
- 5. static void Main()
- 6. {
- 7. Console.Write("n=");
- 8. int n = int.Parse(Console.ReadLine());
- 9. for (int i = 1; i <= n; i++)
- 10. {
- 11. Console.WriteLine(i);
- 12. }
- 13. }
- 14.}
- 9 Problem 9. Sum of n Numbers
- class SumOfNumbers
- 5. static void Main()
- 6. {
- 7. Console.Write("n=");
- 8. int n = int.Parse(Console.ReadLine());
- 9. double sum = 0;
- 10. for (int i = 1; i <= n; i++)
- 11. {
- 12. Console.Write("number{0}=",i);
- 13. double number = double.Parse(Console.ReadLine());
- 14. sum += number;
- 15. }
- 16. Console.WriteLine("Sum={0}",sum);
- 17. }
- 18.}
- 10 fibonachi numbers
- 6. {
- 7. Console.Write("n=");
- 8. int n = int.Parse(Console.ReadLine());
- 9. int fiboTemA = 0;
- 10. int fiboTempB = 1;
- 11. for (int i = 0; i < n; i++)
- 12. {
- 13. Console.Write(fiboTemA + " ");
- 14. int temp = fiboTemA;
- 15. fiboTemA = fiboTempB;
- 16. fiboTempB = temp + fiboTempB;
- 17. }
- 18. }
- 11 Numbers in Interval Dividable by Given Number
- 5. static void Main()
- 6. {
- 7. Console.Write("Start= ");
- 8. int a = int.Parse(Console.ReadLine());
- 9. Console.Write("Stop= ");
- 10. int b = int.Parse(Console.ReadLine());
- 11. for (int i = a; i <= b; i++)
- 12. {
- 13. if (i % 5 == 0)
- 14. {
- 15. Console.Write(i);
- 16. if (i < b - 2)
- 17. {
- 18. Console.Write(",");
- 19. }
- 20. }
- 21.
- 22. }
- Conditional Statements//////////////////////////////////////////////////////////////////////////////////////////////////
- 2 BonusScore
- 4.{
- 5. static void Main ()
- 6. {
- 7. Console.Write("Please, enter a whole number in the range [1 ... 9], SCORE = ");
- 8. string inputStr = Console.ReadLine();
- 9. int score = int.Parse(inputStr);
- 10.
- 11. if (score > 0 && score < 10)
- 12. {
- 13. if (score >= 1 && score <= 3)
- 14. {
- 15. Console.WriteLine("Your Final Score is: {0} !", (score * 10));
- 16. }
- 17. else if (score >= 4 && score <= 6)
- 18. {
- 19. Console.WriteLine("Your Final Score is: {0} !", (score * 100));
- 20. }
- 21 else
- 22. {
- 23. Console.WriteLine("Your Final Score is: {0} !", (score * 1000));
- 24. }
- 25. }
- 26. else
- 27. {
- 28. Console.WriteLine("Input Error - Invalid score !!!");
- 29. }
- 30. Console.ReadLine();
- 31. }
- 3
- class CheckForAPlayCard
- 4.{
- 5. static void Main ()
- 6. {
- 7. Console.Write("Please, enter a character for a sign your play card, CARD: ");
- 8. string card = Console.ReadLine();
- 9. string answer;
- 10. switch (card)
- 11. {
- 12. case "2":
- 13. case "3":
- 14. case "4":
- 15. case "5":
- 16. case "6":
- 17. case "7":
- 18. case "8":
- 19. case "9":
- 20. case "10":
- 21. case "J":
- 22. case "Q":
- 23. case "K":
- 24. case "A":
- 25. answer = "Yes";
- 26. break;
- 27. default:
- 28. answer = "No";
- 29. break;
- 30. }
- 31. Console.WriteLine("That card is a valid Play Card: \"{0}\" !", answer);
- 32. Console.ReadLine();
- 33. }
- 4
- 4 class MultiplicationSign
- 4.{
- 5. static void Main ()
- 6. {
- 7. Console.Write("Please, enter the First real number, A = ");
- 8. string numberStr = Console.ReadLine();
- 9. decimal numA = decimal.Parse(numberStr);
- 10. Console.Write("Enter the Second real number, B = ");
- 11. numberStr = Console.ReadLine();
- 12. decimal numB = decimal.Parse(numberStr);
- 13. Console.Write("Enter the Third real number, C = ");
- 14. numberStr = Console.ReadLine();
- 15. decimal numC = decimal.Parse(numberStr);
- 16.
- 17. char signNum;
- 18. if (numA != 0 && numB != 0 && numC != 0)
- 19. {
- 20. if ((numA > 0 && numB > 0 && numC > 0) || (numA > 0 && numB < 0 && numC < 0)
- 21. || (numA < 0 && numB > 0 && numC < 0) || (numA < 0 && numB < 0 && numC > 0))
- 22. {
- 23. signNum = '+';
- 24. }
- 25. else
- 26. {
- 27. signNum = '-';
- 28. }
- 29. }
- 30. else
- 31. {
- 32. signNum = '0';
- 33. }
- 34. Console.WriteLine("The Sign of Multiplication of these 3 numbers is: SIGN = {0} !",
- 35. signNum);
- 36. Console.ReadLine();
- 37. }
- 5
- 5 class TheBiggestOf3Numbers
- 4.{
- 5. static void Main ()
- 6. {
- 7. Console.Write("Please, enter the First number, A = ");
- 8. string numberStr = Console.ReadLine();
- 9. decimal numA = decimal.Parse(numberStr);
- 10. Console.Write("Enter the Second number, B = ");
- 11. numberStr = Console.ReadLine();
- 12. decimal numB = decimal.Parse(numberStr);
- 13. Console.Write("Enter the Third number, C = ");
- 14. numberStr = Console.ReadLine();
- 15. decimal numC = decimal.Parse(numberStr);
- 16.
- 17. decimal theBiggest;
- 18. if (numA >= numB)
- 19. {
- 20. if (numA >= numC)
- 21. {
- 22. theBiggest = numA;
- 23. }
- 24. else
- 25. {
- 26. theBiggest = numC;
- 27. }
- 28. }
- 29. else
- 30. {
- 31. if (numB >= numC)
- 32. {
- 33. theBiggest = numB;
- 34. }
- 35. else
- 36. {
- 37. theBiggest = numC;
- 38. }
- 39. }
- 40. Console.WriteLine("The Biggest from these 3 numbers is THE BIGGEST = {0} !",
- 41. theBiggest);
- 42. Console.ReadLine();
- 43. }
- 6
- 6 class TheBiggestOfFiveNumbers
- 4.{
- 5. static void Main ()
- 6 {
- 7. Console.Write("Please, enter the First number, A = ");
- 8. string numberStr = Console.ReadLine();
- 9. decimal numA = decimal.Parse(numberStr);
- 10. Console.Write("Enter the Second number, B = ");
- 11. numberStr = Console.ReadLine();
- 12. decimal numB = decimal.Parse(numberStr);
- 13. Console.Write("Enter the next number, C = ");
- 14. numberStr = Console.ReadLine();
- 15. decimal numC = decimal.Parse(numberStr);
- 16. Console.Write("Enter the next number, D = ");
- 17. numberStr = Console.ReadLine();
- 18. decimal numD = decimal.Parse(numberStr);
- 19. Console.Write("Enter the next number, E = ");
- 20. numberStr = Console.ReadLine();
- 21. decimal numE = decimal.Parse(numberStr);
- 22.
- 23. decimal theBiggest;
- 24. if (numA >= numB)
- 25. {
- 26. theBiggest = numA;
- 27. }
- 28. else
- 29. {
- 30. theBiggest = numB;
- 31. }
- 32. if (numC >= theBiggest)
- 33. {
- 34. theBiggest = numC;
- 35. }
- 36. if (numD >= theBiggest)
- 37. {
- 38. theBiggest = numD;
- 39. }
- 40. if (numE >= theBiggest)
- 41. {
- 42. theBiggest = numE;
- 43. }
- 44. Console.WriteLine("The Biggest from these 5 numbers is THE BIGGEST = {0} !",
- 45. theBiggest);
- 46. Console.ReadLine();
- 47. }
- 48.}
- 7
- 7 class Sort3NumbersWithNestedIfs
- 4.{
- 5. static void Main ()
- 6. {
- 7. Console.Write("Please, enter the First real number, A = ");
- 8. string numberStr = Console.ReadLine();
- 9. decimal numA = decimal.Parse(numberStr);
- 10. Console.Write("Enter the Second real number, B = ");
- 11. numberStr = Console.ReadLine();
- 12. decimal numB = decimal.Parse(numberStr);
- 13. Console.Write("Enter the Third real number, C = ");
- 14. numberStr = Console.ReadLine();
- 15. decimal numC = decimal.Parse(numberStr);
- 16.
- 17. decimal theBiggest = 0;
- 18. decimal theMiddle = 0;
- 19. decimal theSmallest = 0;
- 20. if (numA >= numC && numB >= numC)
- 21. {
- 22. theSmallest = numC;
- 23. if (numA >= numB)
- 24. {
- 25. theBiggest = numA;
- 26. theMiddle = numB;
- 27. }
- 28. else
- 29. {
- 30. theBiggest = numB;
- 31. theMiddle = numA;
- 32. }
- 33. }
- 34. else if (numA >= numB && numB <= numC)
- 35. {
- 36. theSmallest = numB;
- 37. if (numA >= numC)
- 38. {
- 39. theBiggest = numA;
- 40. theMiddle = numC;
- 41. }
- 42. else
- 43. {
- 44. theBiggest = numC;
- 45. theMiddle = numA;
- 46. }
- 47. }
- 48. else
- 49. {
- 50. theSmallest = numA;
- 51. if (numB >= numC)
- 52. {
- 53. theBiggest = numB;
- 54. theMiddle = numC;
- 55. }
- 56. else
- 57. {
- 58. theBiggest = numC;
- 59. theMiddle = numB;
- 60. }
- 61. }
- 62. Console.WriteLine("These 3 numbers, sorted in Descending order are: {0}, {1}, {2} !",
- 63. theBiggest, theMiddle, theSmallest);
- 64. Console.ReadLine();
- 65. }
- 66.}
- 8
- 8 nclass DigitAsWord
- 4.{
- 5. static void Main ()
- 6. {
- 7. Console.Write("Please, enter a one digit number (0-9), DIGIT = ");
- 8. string digit = Console.ReadLine();
- 9. string result;
- 10. switch (digit)
- 11. {
- 12. case "0":
- 13. result = "ZERO";
- 14. break;
- 15. case "1":
- 16. result = "ONE";
- 17. break;
- 18. case "2":
- 19. result = "TWO";
- 20. break;
- 21. case "3":
- 22. result = "THREE";
- 23. break;
- 24. case "4":
- 25. result = "FOUR";
- 26. break;
- 27. case "5":
- 28. result = "FIVE";
- 29. break;
- 30. case "6":
- 31. result = "SIX";
- 32. break;
- 33. case "7":
- 34. result = "SEVEN";
- 35. break;
- 36. case "8":
- 37. result = "EIGHT";
- 38. break;
- 39. case "9":
- 40. result = "NINE";
- 41. break;
- 42. default:
- 43. result = "Not a digit !";
- 44. break;
- 45. }
- 46. Console.WriteLine("That digit is - {0} ", result);
- 47. Console.ReadLine();
- 48. }
- 10
- 10 BeerTime
- 2.using System.Threading;
- 3.using System.Globalization;
- 4.
- 5.class BeerTime
- 6.{
- 7. static void Main ()
- 8. {
- 9. Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
- 10. Console.Write(@"Please, enter your time in format ""hh:mm TT"",
- 11.(example 05:30 PM), YOUR TIME = ");
- 12. string timeStr = Console.ReadLine();
- 13. DateTime customTime;
- 14. if (DateTime.TryParse(timeStr, out customTime))
- 15. Console.WriteLine("Converted '{0}' to {1} ({2}).", timeStr, customTime,
- 16. customTime.Kind);
- 17. else
- 18. {
- 19. Console.WriteLine("'{0}' is not in an acceptable format.", timeStr);
- 20. Console.WriteLine("Error - Invalid Time !!!");
- 21. Console.ReadLine();
- 22. return;
- 23. }
- 24.
- 25. DateTime startBeerTime = DateTime.Parse("01:00 PM");
- 26. DateTime endBeerTime = DateTime.Parse("03:00 AM");
- 27. if ((customTime >= endBeerTime) && (customTime < startBeerTime))
- 28. {
- 29. Console.WriteLine("Now is NON-BEER TIME !");
- 30. }
- 31. else
- 32. {
- 33. Console.WriteLine("Now is BEER TIME !");
- 34. }
- 35. Console.ReadLine();
- 36. }
- 37.}
- FOR LOOP //////////////////////////////////////////////////////////////////////////
- 2 class NumbersNotDivisibleBy3And7/////
- 8. int number = int.Parse(Console.ReadLine());
- 9.
- 10. for (int i = 1; i <= number; i++)
- 11. {
- 12. if (i % 3 == 0 || i % 7 == 0)
- 13. {
- 14. continue;
- 15. }
- 16. else
- 17. {
- 18. Console.Write(i + " ");
- 19. }
- 20. }
- 21.
- 22. Console.WriteLine();
- Problem 3. Min, Max, Sum and Average of N Numbers
- 8. int length = int.Parse(Console.ReadLine());
- 9.
- 10. int min = int.MaxValue;
- 11. int max = int.MinValue;
- 12. double sum = 0;
- 13. double avg = 0;
- 14.
- 15. for (int i = 0; i < length; i++)
- 16. {
- 17. int number = int.Parse(Console.ReadLine());
- 18.
- 19. //min
- 20. min = Math.Min(min, number);
- 21.
- 22. //max
- 23. max = Math.Max(max, number);
- 24.
- 25. //sum
- 26. sum += number;
- 27.
- 28. //avg
- 29. avg = sum / length;
- 30. }
- 31.
- 32. Console.WriteLine("Min = " + min);
- 33. Console.WriteLine("Max = " + max);
- 34. Console.WriteLine("Sum = " + sum);
- 35. Console.WriteLine("Avg = {0:F2}", avg);
- 36. }
- Problem 4. Print a Deck of 52 Cards
- string[] cards = { "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A" };
- 8. int[] colors = { 3, 4, 5, 6 };
- 9.
- 10. foreach (var card in cards)
- 11. {
- 12. foreach (var color in colors)
- 13. {
- 14. Console.Write(card);
- 15. Console.Write((char)color + " ");
- 16. }
- 17.
- 18. Console.WriteLine();
- Problem 5. Calculate 1 + 1!/X + 2!/X2 + … + N!/XN
- 7. Console.Write("n = ");
- 8. int n = int.Parse(Console.ReadLine());
- 9. Console.Write("x = ");
- 10. int x = int.Parse(Console.ReadLine());
- 11.
- 12. double factN = 1;
- 13. double multiX = 1;
- 14. double result = 1;
- 15.
- 16. for (int i = 1; i <= n; i++)
- 17. {
- 18. factN *= i;
- 19. multiX *= x;
- 20. result += factN / multiX;
- 21. }
- 22.
- 23. Console.WriteLine("{0:F5}", result);
- 24. }
- Problem 6. Calculate N! / K!
- 8. Console.Write("n = ");
- 9. int n = int.Parse(Console.ReadLine());
- 10. Console.Write("k = ");
- 11. int k = int.Parse(Console.ReadLine());
- 12.
- 13. if (n > 1 && k > 1 && n < 100 && k < 100)
- 14. {
- 15. BigInteger factN = 1;
- 16. BigInteger factK = 1;
- 17. BigInteger result = 0;
- 18.
- 19. for (int i = 1; i <= n; i++)
- 20. {
- 21. factN *= i;
- 22. }
- 23.
- 24. for (int j = 1; j <= k; j++)
- 25. {
- 26. factK *= j;
- 27. }
- 28.
- 29. result = factN / factK;
- 30.
- 31. Console.WriteLine(result);
- 32. }
- 33. else
- 34. {
- 35. Console.WriteLine("Invalid input!");
- 36. }
- 7 Problem 7. Calculate N! / (K! * (N-K)!)
- 5.{
- 6. static void Main()
- 7. {
- 8. Console.Write("n = ");
- 9. int n = int.Parse(Console.ReadLine());
- 10. Console.Write("k = ");
- 11. int k = int.Parse(Console.ReadLine());
- 12.
- 13. if (n > 1 && k > 1 && n < 100 && k < 100)
- 14. {
- 15. BigInteger factN = 1;
- 16. BigInteger factK = 1;
- 17. BigInteger factNAndK = 1;
- 18. BigInteger result = 0;
- 19.
- 20. for (int i = 1; i <= n; i++)
- 21. {
- 22. factN *= i;
- 23. }
- 24.
- 25. for (int j = 1; j <= k; j++)
- 26. {
- 27. factK *= j;
- 28. }
- 29.
- 30. for (int z = 1; z <= n - k; z++)
- 31. {
- 32. factNAndK *= z;
- 33. }
- 34.
- 35. result = factN / (factK * factNAndK);
- 36.
- 37. Console.WriteLine(result);
- 38. }
- 39. else
- 40. {
- 41. Console.WriteLine("Invalid input!");
- 42. }
- Problem 8. Catalan Numbers
- 8. Console.Write("n = ");
- 9. int n = int.Parse(Console.ReadLine());
- 10.
- 11. if (n > 1 && n < 100)
- 12. {
- 13. BigInteger multiFactN = 1;
- 14. BigInteger plusFactN = 1;
- 15. BigInteger factN = 1;
- 16. BigInteger result = 0;
- 17.
- 18. for (int i = 1; i <= 2 * n; i++)
- 19. {
- 20. multiFactN *= i;
- 21. }
- 22.
- 23. for (int j = 1; j <= n + 1; j++)
- 24. {
- 25. plusFactN *= j;
- 26. }
- 27.
- 28. for (int k = 1; k <= n; k++)
- 29. {
- 30. factN *= k;
- 31. }
- 32.
- 33. result = multiFactN / (plusFactN * factN);
- 34.
- 35. Console.WriteLine(result);
- 36. }
- 37. else
- 38. {
- 39. Console.WriteLine("Invalid input!");
- 40. }
- Problem 9. Matrix of Numbers
- 7. Console.Write("n = ");
- 8. int n = int.Parse(Console.ReadLine());
- 9.
- 10. if (n > 1 && n < 20)
- 11. {
- 12. for (int i = 0; i < n; i++)
- 13. {
- 14. for (int j = i + 1; j <= n + i; j++)
- 15. {
- 16. Console.Write(j + " ");
- 17. }
- 18.
- 19. Console.WriteLine();
- 20. }
- 21. }
- 22. else
- 23. {
- 24. Console.WriteLine("Invalid input!");
- 25. }
- Problem 10. Odd and Even Product
- 7. int even = 1;
- 8. int odd = 1;
- 9.
- 10. string readNumbers = Console.ReadLine();
- 11. string[] numbers = readNumbers.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
- 12.
- 13. for (int i = 0; i < numbers.Length; i++)
- 14. {
- 15. int number = int.Parse(numbers[i]);
- 16.
- 17. if (i % 2 == 0)
- 18. {
- 19. even *= number;
- 20. }
- 21. else
- 22. {
- 23. odd *= number;
- 24. }
- 25. }
- 26.
- 27. if (even == odd)
- 28. {
- 29. Console.WriteLine("yes");
- 30. Console.WriteLine("product = " + even);
- 31. }
- 32. else
- 33. {
- 34. Console.WriteLine("no");
- 35. Console.WriteLine("odd_product = " + odd);
- 36. Console.WriteLine("even_product = " + even);
- 37. }
- Problem 11. Random Numbers in Given Range
- 7. Console.Write("n = ");
- 8. int n = int.Parse(Console.ReadLine());
- 9. Console.Write("min = ");
- 10. int min = int.Parse(Console.ReadLine());
- 11. Console.Write("max = ");
- 12. int max = int.Parse(Console.ReadLine());
- 13.
- 14. if (min <= max)
- 15. {
- 16. Random random = new Random();
- 17.
- 18. for (int i = 0; i < n; i++)
- 19. {
- 20. Console.Write(random.Next(min, max + 1) + " ");
- 21. }
- 22.
- 23. Console.WriteLine();
- 24. }
- Problem 12. * Randomize the Numbers 1…N
- 7. Console.Write("n = ");
- 8. int n = int.Parse(Console.ReadLine());
- 9.
- 10. Random randomNumbers = new Random();
- 11.
- 12. for (int i = 1; i <= n; i++)
- 13. {
- 14. Console.Write(randomNumbers.Next(1, n + 1) + " ");
- 15. }
- 16.
- 17. Console.WriteLine();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement