Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- string [] name = new string[n];
- for(int i = 0; i < name.Length ; i++)
- {
- name[i] = (Console.ReadLine());
- }
- Array.Sort(name);
- Array.Reverse(name);
- int countI = 0;
- int counti = 0;
- for(int i = 0; i< name.Length ; i++)
- {
- Console.WriteLine(" {0}.{1}", i + 1, name[i]);
- if(name[i] == "ivan")
- {
- countI++;
- }
- if (name[i][0] == 'i')
- {
- counti++;
- }
- }
- Console.WriteLine("Имената \"Иван\" са {0}", countI);
- Console.WriteLine("Имената с И са {0}", counti);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement