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 ConsoleApp9
- {
- class Program
- {
- class Automobil
- {
- public string proizvodac;
- public string model;
- public int snaga;
- public string dohvatiDetalje()
- {
- return "Proizvodac: " + this.proizvodac + "\nModel: " + this.model +
- "\nSnaga: " + this.snaga;
- }
- }
- static void Main(string[] args)
- {
- List<Automobil> auti = new List<Automobil>();
- for (int i = 0; i < 5; i++)
- {
- Console.Write("Proizvodac: ");
- auti[i].proizvodac = Console.ReadLine();
- Console.Write("Model: ");
- auti[i].model = Console.ReadLine();
- Console.Write("Snaga: ");
- auti[i].snaga = int.Parse(Console.ReadLine());
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement