/
NAJE
/
ControlWork
Обзор
Документация
Войти
/
NAJE
/
ControlWork
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Program.cs
130 строк
3 KB
temach113
Новые файлы
25 окт 2025, 16:12
25 окт 2025, 16:12
e14a980
Код
Авторство
О чём код?
namespace ControlWork; class Program { // Номер 1 // static void Main(string[] args) // { // int[] nums = new int[] {3,15,5,14}; // Sorted(nums); // Console.WriteLine(nums[0]); // } // public static void Sorted(int[] nums) // { // for(int i = 0; i < nums.Length; i++) // { // for(int j = i + 1; j < nums.Length; j++) // { // if (nums[i] > nums[j]) // { // int temp = nums[i]; // nums[i] = nums[j]; // nums[j] = temp; // } // } // } // } //Второе задание // static void Main(string[] args) // { // Console.WriteLine(IsLower("BananaRama")); // } // public static int IsLower(string lower) // { // int c = 0; // for(int i = 0; i < lower.Length; i ++) // { // if (Char.IsLower(lower[i])) // { // c++; // } // } // return c; // } // Третье задание // static void Main(string[] args) // { // Position("ABCDEFGAABCD"); // } // public static void Position(string s) // { // Console.WriteLine(s[^3]); // } // 4 задание; // static void Main(string[] args) // { // Console.WriteLine(IsPalindrome(134)); // } // public static bool IsPalindrome(int x) // { // string strX = x.ToString(); // for(int i = 0; i < strX.Length/2; i++) // { // if (strX[i] != strX[strX.Length - 1 - i]) // { // return false; // } // } // return true; // } // 5 задание; // static void Main(string[] args) // { // int[] num = new int[] {0,3,14,8,2,94}; // RunningSum(num); // // for(int i = 0; i < num.Length; i++) // // { // // Console.WriteLine(num[i]); // // } // } // public static int[] RunningSum(int[] nums) // { // int[] result = new int[nums.Length]; // int sum = 0; // for(int i = 0; i < nums.Length; i++) // { // for( int j = 0; j < i; j ++) // { // result[i] += nums[j]; // } // Console.WriteLine(result[i]); // } // return result; // } // 6 задание // static void Main(string[] args) // { // Console.WriteLine(TryParse1("12345a",out int number)); // } // public static bool TryParse1(string str, out int number) // { // number = 0; // bool istTrueOrFalse = true; // for(int i = 0; i < str.Length; i++) // { // if(Char.IsDigit(str[i]) == false) // { // istTrueOrFalse = false; // break; // } // } // if(istTrueOrFalse == true) // { // number = int.Parse(str); // } // return istTrueOrFalse; // } }