Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#1
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication2
- {
- class Program
- {
- static void Kelet(int[] a)
- {
- for (int i = 0; i < a.Length; i++)
- a[i] = int.Parse(Console.ReadLine());
- }
- static bool T37(int[] a)
- {
- int counter7 = 0, counter3 = 0;
- for (int i = 0; i < a.Length; i++)
- {
- if (a[i] % 7 == 0)
- counter7++;
- if (a[i] % 3 == 0)
- counter3++;
- }
- return counter3 > counter7;
- }
- static void Main(string[] args)
- {
- int[] a = new int[10];
- Kelet(a);
- Console.WriteLine(T37(a));
- }
- }
- }
- //#2
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication2
- {
- class Program
- {
- static void Kelet(int[] a)
- {
- for (int i = 0; i < a.Length; i++)
- a[i] = int.Parse(Console.ReadLine());
- }
- static int Smallest(int num)
- {
- int min = 0;
- while (num != 0)
- {
- if (num % 10 > min)
- min = num;
- num /= 10;
- }
- return min;
- }
- static int Biggest(int num)
- {
- int max = 10;
- while (num != 0)
- {
- if (num % 10 < max)
- max = num;
- num /= 10;
- }
- return max;
- }
- static void Main(string[] args)
- {
- int[] a = new int[10];
- Kelet(a);
- for (int i = 0; i < a.Length - 1; i++)
- {
- Console.WriteLine(Biggest(a[i]) + Smallest(a[i+1]));
- }
- }
- }
- }
- //#3
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication2
- {
- class Program
- {
- static void Kelet(int[] a)
- {
- for (int i = 0; i < a.Length; i++)
- a[i] = int.Parse(Console.ReadLine());
- }
- static bool Middle(int a, int b, int c)
- {
- return (b > a && b > c);
- }
- static void Main(string[] args)
- {
- int[] a = new int[10];
- Kelet(a);
- int counter = 0;
- for (int i = 2; i < a.Length; i++)
- if (Middle(a[i - 2], a[i - 1], a[i]))
- counter++;
- Console.WriteLine(counter);
- }
- }
- }
- //#4
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication2
- {
- class Program
- {
- static void Kelet(int[] a)
- {
- for (int i = 0; i < a.Length; i++)
- a[i] = int.Parse(Console.ReadLine());
- }
- static double Do(int[] a)
- {
- int n = a.Length;
- if (n % 2 == 0)
- {
- return (a[n / 2 - 1] + a[n / 2]) / 2;
- }
- else
- {
- return a[n / 2];
- }
- }
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int[] a = new int[n];
- Kelet(a);
- a[0] = (int)Do(a);
- }
- }
- }
- //#5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement