Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication12
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Укажите количество чисел");
- int N = int.Parse(Console.ReadLine());
- int i, j, dub, K, max; j = 0; K = 0;
- if (N > 1000) Console.WriteLine("НЗД");
- else
- {
- Console.WriteLine("Укажите предел значений");
- int Lim = int.Parse(Console.ReadLine());
- int[] A = new int[N];
- int[] B = new int[N];
- Console.WriteLine("Введите числа");
- for (i = 0; i < N; i++)
- {
- A[i] = int.Parse(Console.ReadLine());
- if (A[i] > 3000 || A[i] < 0)
- {
- Console.WriteLine("НЗД, введите число ещё раз");
- A[i] = int.Parse(Console.ReadLine());
- }
- }
- for (i = 0; i < N; i++)
- {
- Math.DivRem(A[i], 10, out dub);
- if (dub == 1)
- {
- B[j] = A[i]; j++; K = j;
- }
- }
- if (K != 0)
- {
- max = B[0];
- for (j = 0; j < K; j++)
- {
- if (max < B[j])
- max = B[j];
- } Console.WriteLine("Наибольшее число = {0}", max); Console.ReadKey();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement