{"action":"created","comment":{"url":"https://api.github.com/repos/Kirill-Andreev/University/pulls/comments/53570151","id":53570151,"diff_hunk":"@@ -0,0 +1,89 @@\n+﻿using System;\n+\n+namespace Task_5\n+{\n+    /// <summary>\n+    /// Class Program\n+    /// main program displays matrix \n+    /// with sorted columns\n+    /// </summary>\n+    class Program\n+    {\n+        /// <summary>\n+        /// Method SortMatrixByColumns()\n+        /// sorts the columns of the matrix\n+        /// by the first element\n+        /// </summary>\n+        /// <param name=\"array\"></param>\n+        /// <param name=\"rows\"></param>\n+        /// <param name=\"columns\"></param>\n+        private static void SortMatrixByColumns(int[,] array, int rows, int columns)\n+        {\n+            for (int i = 0; i < columns; ++i)\n+            {\n+                for (int j = columns - 1; j > i; --j)\n+                {\n+                    if (array[0, j - 1] > array[0, j])\n+                    {\n+                        for (int n = 0; n < rows; ++n)\n+                        {\n+                            int temp = array[n, j - 1];\n+                            array[n, j - 1] = array[n, j];\n+                            array[n, j] = temp;\n+                        }\n+                    }\n+                }\n+            }\n+        }\n+\n+        /// <summary>\n+        /// Method MatrixOutput()\n+        /// prints the elements of the matrix \n+        /// row by row\n+        /// </summary>\n+        /// <param name=\"array\"></param>\n+        /// <param name=\"rows\"></param>\n+        /// <param name=\"columns\"></param>\n+        private static void MatrixOutput(int[,] array, int rows, int columns)\n+        {\n+            for (int i = 0; i < rows; ++i)\n+            {\n+                for (int j = 0; j < columns; ++j)\n+                {\n+                    Console.Write(array[i, j] + \" \");\n+                }\n+                Console.WriteLine();\n+            }\n+        }\n+\n+        /// <summary>\n+        /// Method Main()\n+        /// is the entry point of the program\n+        /// </summary>\n+        /// <param name=\"args\"></param>\n+        public static void Main(string[] args)\n+        {\n+            int rows = 0;\n+            int columns = 0;","path":"Homework_1/Task_5/Task_5/Program.cs","position":67,"original_position":67,"commit_id":"798e813cf6a6ca11eb40b94aac0a86370bdd2f5c","original_commit_id":"798e813cf6a6ca11eb40b94aac0a86370bdd2f5c","user":{"login":"yurii-litvinov","id":706768,"avatar_url":"https://avatars.githubusercontent.com/u/706768?v=3","gravatar_id":"","url":"https://api.github.com/users/yurii-litvinov","html_url":"https://github.com/yurii-litvinov","followers_url":"https://api.github.com/users/yurii-litvinov/followers","following_url":"https://api.github.com/users/yurii-litvinov/following{/other_user}","gists_url":"https://api.github.com/users/yurii-litvinov/gists{/gist_id}","starred_url":"https://api.github.com/users/yurii-litvinov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurii-litvinov/subscriptions","organizations_url":"https://api.github.com/users/yurii-litvinov/orgs","repos_url":"https://api.github.com/users/yurii-litvinov/repos","events_url":"https://api.github.com/users/yurii-litvinov/events{/privacy}","received_events_url":"https://api.github.com/users/yurii-litvinov/received_events","type":"User","site_admin":false},"body":"тоже, не надо объявлять переменные до того, как они нужны, это же не Паскаль :)","created_at":"2016-02-21T17:50:21Z","updated_at":"2016-02-21T17:50:21Z","html_url":"https://github.com/Kirill-Andreev/University/pull/5#discussion_r53570151","pull_request_url":"https://api.github.com/repos/Kirill-Andreev/University/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/Kirill-Andreev/University/pulls/comments/53570151"},"html":{"href":"https://github.com/Kirill-Andreev/University/pull/5#discussion_r53570151"},"pull_request":{"href":"https://api.github.com/repos/Kirill-Andreev/University/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/Kirill-Andreev/University/pulls/5","id":60080927,"html_url":"https://github.com/Kirill-Andreev/University/pull/5","diff_url":"https://github.com/Kirill-Andreev/University/pull/5.diff","patch_url":"https://github.com/Kirill-Andreev/University/pull/5.patch","issue_url":"https://api.github.com/repos/Kirill-Andreev/University/issues/5","number":5,"state":"open","locked":false,"title":"Sort matrix by columns","user":{"login":"Kirill-Andreev","id":14337005,"avatar_url":"https://avatars.githubusercontent.com/u/14337005?v=3","gravatar_id":"","url":"https://api.github.com/users/Kirill-Andreev","html_url":"https://github.com/Kirill-Andreev","followers_url":"https://api.github.com/users/Kirill-Andreev/followers","following_url":"https://api.github.com/users/Kirill-Andreev/following{/other_user}","gists_url":"https://api.github.com/users/Kirill-Andreev/gists{/gist_id}","starred_url":"https://api.github.com/users/Kirill-Andreev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kirill-Andreev/subscriptions","organizations_url":"https://api.github.com/users/Kirill-Andreev/orgs","repos_url":"https://api.github.com/users/Kirill-Andreev/repos","events_url":"https://api.github.com/users/Kirill-Andreev/events{/privacy}","received_events_url":"https://api.github.com/users/Kirill-Andreev/received_events","type":"User","site_admin":false},"body":"Sort random matrix by the first elements of columns","created_at":"2016-02-21T09:48:03Z","updated_at":"2016-02-21T17:50:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6e6f8958f2bab2b28d70c915c0c16568653aa4aa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Kirill-Andreev/University/pulls/5/commits","review_comments_url":"https://api.github.com/repos/Kirill-Andreev/University/pulls/5/comments","review_comment_url":"https://api.github.com/repos/Kirill-Andreev/University/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Kirill-Andreev/University/issues/5/comments","statuses_url":"https://api.github.com/repos/Kirill-Andreev/University/statuses/798e813cf6a6ca11eb40b94aac0a86370bdd2f5c","head":{"label":"Kirill-Andreev:Sort-matrix-by-columns","ref":"Sort-matrix-by-columns","sha":"798e813cf6a6ca11eb40b94aac0a86370bdd2f5c","user":{"login":"Kirill-Andreev","id":14337005,"avatar_url":"https://avatars.githubusercontent.com/u/14337005?v=3","gravatar_id":"","url":"https://api.github.com/users/Kirill-Andreev","html_url":"https://github.com/Kirill-Andreev","followers_url":"https://api.github.com/users/Kirill-Andreev/followers","following_url":"https://api.github.com/users/Kirill-Andreev/following{/other_user}","gists_url":"https://api.github.com/users/Kirill-Andreev/gists{/gist_id}","starred_url":"https://api.github.com/users/Kirill-Andreev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kirill-Andreev/subscriptions","organizations_url":"https://api.github.com/users/Kirill-Andreev/orgs","repos_url":"https://api.github.com/users/Kirill-Andreev/repos","events_url":"https://api.github.com/users/Kirill-Andreev/events{/privacy}","received_events_url":"https://api.github.com/users/Kirill-Andreev/received_events","type":"User","site_admin":false},"repo":{"id":42678978,"name":"University","full_name":"Kirill-Andreev/University","owner":{"login":"Kirill-Andreev","id":14337005,"avatar_url":"https://avatars.githubusercontent.com/u/14337005?v=3","gravatar_id":"","url":"https://api.github.com/users/Kirill-Andreev","html_url":"https://github.com/Kirill-Andreev","followers_url":"https://api.github.com/users/Kirill-Andreev/followers","following_url":"https://api.github.com/users/Kirill-Andreev/following{/other_user}","gists_url":"https://api.github.com/users/Kirill-Andreev/gists{/gist_id}","starred_url":"https://api.github.com/users/Kirill-Andreev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kirill-Andreev/subscriptions","organizations_url":"https://api.github.com/users/Kirill-Andreev/orgs","repos_url":"https://api.github.com/users/Kirill-Andreev/repos","events_url":"https://api.github.com/users/Kirill-Andreev/events{/privacy}","received_events_url":"https://api.github.com/users/Kirill-Andreev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Kirill-Andreev/University","description":"","fork":false,"url":"https://api.github.com/repos/Kirill-Andreev/University","forks_url":"https://api.github.com/repos/Kirill-Andreev/University/forks","keys_url":"https://api.github.com/repos/Kirill-Andreev/University/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kirill-Andreev/University/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kirill-Andreev/University/teams","hooks_url":"https://api.github.com/repos/Kirill-Andreev/University/hooks","issue_events_url":"https://api.github.com/repos/Kirill-Andreev/University/issues/events{/number}","events_url":"https://api.github.com/repos/Kirill-Andreev/University/events","assignees_url":"https://api.github.com/repos/Kirill-Andreev/University/assignees{/user}","branches_url":"https://api.github.com/repos/Kirill-Andreev/University/branches{/branch}","tags_url":"https://api.github.com/repos/Kirill-Andreev/University/tags","blobs_url":"https://api.github.com/repos/Kirill-Andreev/University/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kirill-Andreev/University/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kirill-Andreev/University/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kirill-Andreev/University/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kirill-Andreev/University/statuses/{sha}","languages_url":"https://api.github.com/repos/Kirill-Andreev/University/languages","stargazers_url":"https://api.github.com/repos/Kirill-Andreev/University/stargazers","contributors_url":"https://api.github.com/repos/Kirill-Andreev/University/contributors","subscribers_url":"https://api.github.com/repos/Kirill-Andreev/University/subscribers","subscription_url":"https://api.github.com/repos/Kirill-Andreev/University/subscription","commits_url":"https://api.github.com/repos/Kirill-Andreev/University/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kirill-Andreev/University/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kirill-Andreev/University/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kirill-Andreev/University/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kirill-Andreev/University/contents/{+path}","compare_url":"https://api.github.com/repos/Kirill-Andreev/University/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kirill-Andreev/University/merges","archive_url":"https://api.github.com/repos/Kirill-Andreev/University/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kirill-Andreev/University/downloads","issues_url":"https://api.github.com/repos/Kirill-Andreev/University/issues{/number}","pulls_url":"https://api.github.com/repos/Kirill-Andreev/University/pulls{/number}","milestones_url":"https://api.github.com/repos/Kirill-Andreev/University/milestones{/number}","notifications_url":"https://api.github.com/repos/Kirill-Andreev/University/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kirill-Andreev/University/labels{/name}","releases_url":"https://api.github.com/repos/Kirill-Andreev/University/releases{/id}","deployments_url":"https://api.github.com/repos/Kirill-Andreev/University/deployments","created_at":"2015-09-17T20:01:39Z","updated_at":"2016-02-21T17:40:52Z","pushed_at":"2016-02-21T17:41:33Z","git_url":"git://github.com/Kirill-Andreev/University.git","ssh_url":"git@github.com:Kirill-Andreev/University.git","clone_url":"https://github.com/Kirill-Andreev/University.git","svn_url":"https://github.com/Kirill-Andreev/University","homepage":null,"size":27,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"Kirill-Andreev:master","ref":"master","sha":"fa42749084f195b38970f2516cbd459321ec4248","user":{"login":"Kirill-Andreev","id":14337005,"avatar_url":"https://avatars.githubusercontent.com/u/14337005?v=3","gravatar_id":"","url":"https://api.github.com/users/Kirill-Andreev","html_url":"https://github.com/Kirill-Andreev","followers_url":"https://api.github.com/users/Kirill-Andreev/followers","following_url":"https://api.github.com/users/Kirill-Andreev/following{/other_user}","gists_url":"https://api.github.com/users/Kirill-Andreev/gists{/gist_id}","starred_url":"https://api.github.com/users/Kirill-Andreev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kirill-Andreev/subscriptions","organizations_url":"https://api.github.com/users/Kirill-Andreev/orgs","repos_url":"https://api.github.com/users/Kirill-Andreev/repos","events_url":"https://api.github.com/users/Kirill-Andreev/events{/privacy}","received_events_url":"https://api.github.com/users/Kirill-Andreev/received_events","type":"User","site_admin":false},"repo":{"id":42678978,"name":"University","full_name":"Kirill-Andreev/University","owner":{"login":"Kirill-Andreev","id":14337005,"avatar_url":"https://avatars.githubusercontent.com/u/14337005?v=3","gravatar_id":"","url":"https://api.github.com/users/Kirill-Andreev","html_url":"https://github.com/Kirill-Andreev","followers_url":"https://api.github.com/users/Kirill-Andreev/followers","following_url":"https://api.github.com/users/Kirill-Andreev/following{/other_user}","gists_url":"https://api.github.com/users/Kirill-Andreev/gists{/gist_id}","starred_url":"https://api.github.com/users/Kirill-Andreev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kirill-Andreev/subscriptions","organizations_url":"https://api.github.com/users/Kirill-Andreev/orgs","repos_url":"https://api.github.com/users/Kirill-Andreev/repos","events_url":"https://api.github.com/users/Kirill-Andreev/events{/privacy}","received_events_url":"https://api.github.com/users/Kirill-Andreev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Kirill-Andreev/University","description":"","fork":false,"url":"https://api.github.com/repos/Kirill-Andreev/University","forks_url":"https://api.github.com/repos/Kirill-Andreev/University/forks","keys_url":"https://api.github.com/repos/Kirill-Andreev/University/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kirill-Andreev/University/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kirill-Andreev/University/teams","hooks_url":"https://api.github.com/repos/Kirill-Andreev/University/hooks","issue_events_url":"https://api.github.com/repos/Kirill-Andreev/University/issues/events{/number}","events_url":"https://api.github.com/repos/Kirill-Andreev/University/events","assignees_url":"https://api.github.com/repos/Kirill-Andreev/University/assignees{/user}","branches_url":"https://api.github.com/repos/Kirill-Andreev/University/branches{/branch}","tags_url":"https://api.github.com/repos/Kirill-Andreev/University/tags","blobs_url":"https://api.github.com/repos/Kirill-Andreev/University/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kirill-Andreev/University/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kirill-Andreev/University/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kirill-Andreev/University/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kirill-Andreev/University/statuses/{sha}","languages_url":"https://api.github.com/repos/Kirill-Andreev/University/languages","stargazers_url":"https://api.github.com/repos/Kirill-Andreev/University/stargazers","contributors_url":"https://api.github.com/repos/Kirill-Andreev/University/contributors","subscribers_url":"https://api.github.com/repos/Kirill-Andreev/University/subscribers","subscription_url":"https://api.github.com/repos/Kirill-Andreev/University/subscription","commits_url":"https://api.github.com/repos/Kirill-Andreev/University/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kirill-Andreev/University/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kirill-Andreev/University/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kirill-Andreev/University/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kirill-Andreev/University/contents/{+path}","compare_url":"https://api.github.com/repos/Kirill-Andreev/University/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kirill-Andreev/University/merges","archive_url":"https://api.github.com/repos/Kirill-Andreev/University/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kirill-Andreev/University/downloads","issues_url":"https://api.github.com/repos/Kirill-Andreev/University/issues{/number}","pulls_url":"https://api.github.com/repos/Kirill-Andreev/University/pulls{/number}","milestones_url":"https://api.github.com/repos/Kirill-Andreev/University/milestones{/number}","notifications_url":"https://api.github.com/repos/Kirill-Andreev/University/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kirill-Andreev/University/labels{/name}","releases_url":"https://api.github.com/repos/Kirill-Andreev/University/releases{/id}","deployments_url":"https://api.github.com/repos/Kirill-Andreev/University/deployments","created_at":"2015-09-17T20:01:39Z","updated_at":"2016-02-21T17:40:52Z","pushed_at":"2016-02-21T17:41:33Z","git_url":"git://github.com/Kirill-Andreev/University.git","ssh_url":"git@github.com:Kirill-Andreev/University.git","clone_url":"https://github.com/Kirill-Andreev/University.git","svn_url":"https://github.com/Kirill-Andreev/University","homepage":null,"size":27,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Kirill-Andreev/University/pulls/5"},"html":{"href":"https://github.com/Kirill-Andreev/University/pull/5"},"issue":{"href":"https://api.github.com/repos/Kirill-Andreev/University/issues/5"},"comments":{"href":"https://api.github.com/repos/Kirill-Andreev/University/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/Kirill-Andreev/University/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/Kirill-Andreev/University/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Kirill-Andreev/University/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/Kirill-Andreev/University/statuses/798e813cf6a6ca11eb40b94aac0a86370bdd2f5c"}}}}