Jump to content

Stie cineva sa rezolve aceasta problema?(Pascal)

Alexandru Cristian

Recommended Posts

Ma dau pe nenumarate site-uri si forumuri de programare, dar inca cod postat sub forma de screenshot n-am vazut :))

REM asa se scrie cod
For i=1 to n
 x = x + 1
Next i

ca poate nu stiati ;)

Link to comment
Share on other sites

La a 3a problema, daca vrei in C#. Pascal nu stiu.

Eu am facut sa se genereze automat numerele.

int[,] a;
            int n, i, j,x,y;
            a = new int[n, n];
            Random r = new Random();
            for (i = 0; i < n; i++)
                for (j = 0; j < n; j++)
                    a[i, j] = r.Next(89)+10;

            for (i = 0; i < n; i++)
                for (j = 0; j < n; j++)
                    Console.Write(a[i, j] + " ");


            Console.Write("Elementele de pe linia x:");
            for (i = 0; i < n-1; i++)
                Console.Write(a[x, i] + " ");
            Console.Write("Elementele de pe coloana y:");
            for (i=0;i<n;i++)
                Console.Write(a[i, y] + " ");
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Who's Online (See full list)

    There are no registered users currently online

  • Create New...

Important Information

Terms of Use