Advertisement
Sim0o0na

04. Cat Numbers

Jun 18th, 2018
503
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Test
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             int n = int.Parse(Console.ReadLine());
  15.  
  16.  
  17.             for (int i = 1; i <= n; i++)
  18.             {
  19.                 string firstName = Console.ReadLine();
  20.                 string lastName = Console.ReadLine();
  21.                 int yearOfBirth = int.Parse(Console.ReadLine());
  22.                 string catNumber = "";
  23.                 catNumber += yearOfBirth;
  24.                 catNumber += (int)firstName[0];
  25.                 catNumber += (int)lastName[0];
  26.                 catNumber += i;
  27.                 Console.WriteLine(catNumber);
  28.             }
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement