Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("son kiriting");
            int a = Convert.ToInt32(Console.ReadLine());
            int[] massive = new int[20];
            
            Random r = new Random();           
            for (int i = 0; i < 20; i++)
            {
                massive[i] = r.Next(-10, 10);
                if (i>a)
                {
                      Console.Write("massive["+i + "]=" + massive[i] + " ");
                }
            }
            Console.WriteLine();
            
            Console.ReadKey();
        } 
    }
}


What I have tried:

Nothing ...........................................
Posted
Updated 28-May-21 5:11am
v2

1. Learn C#.
2. Learn C++.
3. Rewrite in the language of your choice.
 
Share this answer
 
This is not a code conversion service: we are not here to translate code for you.
Even if we did, what you would end up with would not be "good code" in the target language – they are based on very different frameworks, and what makes something work in one language does not always "translate" directly into another.
So what you end up with is very poor code, that is difficult if not impossible to maintain, that can’t be upgraded nicely, and that will cause you immense headaches if the original is changed. And it’ll be a nightmare to debug if it doesn’t work "straight out of the box".
Instead, use the source code as a specification for a new app written in and for the target language / framework and write it from scratch using the original as a "template". You will get a much, much better result that will save you a lot of time in the long run.

And to be honest, if you can't write that simple a code on your own, you should perhaps rethink your choice of courses ...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900