Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main() //2003 ex 9
- {
- int[,] arr = new int[18, 25];
- string smallLoc = "0,0";
- for (int i = 0; i < arr.GetLength(0); i++)
- {
- for (int j = 0; j < arr.GetLength(1); j++)
- arr[i, j] += int.Parse(Console.ReadLine());
- }
- for (int i = 0; i < arr.GetLength(0); i++)
- {
- for (int j = 0; j < arr.GetLength(1); j++)
- if (arr[i, j] < arr[int.Parse(smallLoc.Substring(0, smallLoc.IndexOf(','))), int.Parse(smallLoc.Substring(smallLoc.IndexOf(',')))])
- smallLoc = i + "," + j;
- }
- }
- static void Main() //2003 ex 8
- {
- string st, newSt = "";
- st = Console.ReadLine();
- st = st.Replace(" ", "");
- Console.WriteLine(st);
- for (int i = 0; i < st.Length; i++)
- {
- newSt += st[i];
- if (st[i] < 'M')
- newSt += (char)((int)st[i] + 1);
- else
- newSt += (char)((int)st[i] - 1);
- }
- Console.WriteLine("Encrypted: " + newSt);
- }
- public static bool Increasing(int[,] arr) //1997 ex. 10
- {
- int currentSum = 0, lastSum = 0;
- for (int i = 0; i < arr.GetLength(0); i++)
- {
- for (int j = 0; j < arr.GetLength(1); j++)
- currentSum += arr[i, j];
- Console.WriteLine("Current sum: " + currentSum);
- if (currentSum < lastSum)
- return false;
- lastSum = currentSum;
- currentSum = 0;
- }
- return true;
- }
- static void Main() //1997 ex. 10
- {
- int[,] arr = new int[10, 20];
- for (int i = 0; i < arr.GetLength(0); i++)
- {
- for (int j = 0; j < arr.GetLength(1); j++)
- arr[i, j] = int.Parse(Console.ReadLine());
- }
- Console.WriteLine(Increasing(arr));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement