Advertisement
Guest User

Untitled

a guest
Feb 18th, 2014
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.35 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             string[] tomb1 = new string[5] { "Jani", "Laci", "Lili", "Gábor", "Ádám" };
  13.             string[] tomb2 = new string[5];
  14.             Console.WriteLine("1.Jani\t2.Laci\t3.Lili\t4.Gábor\t5.Ádám");
  15.             Console.WriteLine("FORMA: NEM/ÉÉ/HH/NN");
  16.             int szemelyi = 0;
  17.             string viszga = String.Empty;
  18.             for (int i = 0; i < tomb2.Length; i++)
  19.             {
  20.                 Console.Write("Add meg az {0}. személyi számot: ", i + 1);
  21.                 tomb2[i] = Console.ReadLine();
  22.  
  23.             }
  24.             for (int i = 0; i < tomb2.Length; i++)
  25.             {
  26.                 viszga = tomb2[i].Substring(0, 1);
  27.                 szemelyi = Convert.ToInt32(tomb2[i].Substring(3, 4));
  28.                 if (viszga != "2")
  29.  
  30.                     if (321 > szemelyi && 219 < szemelyi)
  31.  
  32.                         Console.WriteLine("{0} a halak jegyben született, ekkor: {1}", tomb1[i], szemelyi);
  33.                     else Console.WriteLine("{0} NEM született halaknak.",tomb1[i]);
  34.                 else Console.WriteLine("{0} NEM férfi.",tomb1[i]);
  35.  
  36.             }
  37.             Console.ReadLine();
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement