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 ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- // 1. feladat
- Console.Write("Adja meg hány ember adatát mérte fel : ");
- int elemszam;
- elemszam = Convert.ToInt32(Console.ReadLine());
- // 2. feladat
- string[] tomb = new string[elemszam];
- // 3. feladat
- for (int i = 0; i < tomb.Length; i++)
- {
- Console.Write("Adja meg a következő ember nemzetiségét : ");
- tomb[i] = Console.ReadLine();
- }
- // 4. feladat
- int nulla = 0;
- for (int i = 0; i < tomb.Length; i++)
- {
- if (tomb[i] == "")
- {
- nulla++;
- }
- }
- Console.WriteLine();
- // 6. feladat
- for (int i = 0; i < tomb.Length; i++)
- {
- if (tomb[i] == "olasz")
- {
- // 7. feladat
- Console.WriteLine("Van olasz");
- break;
- }
- else
- {
- Console.WriteLine("Nincs olasz");
- }
- }
- // 5. feladat
- Console.WriteLine(nulla + " ember volt aki nem adta meg a nemzetiségét.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement