Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 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 ConsoleApp9
  8. {
  9. class Program
  10. {
  11. class Automobil
  12. {
  13. public string proizvodac;
  14. public string model;
  15. public int snaga;
  16.  
  17. public string dohvatiDetalje()
  18. {
  19. return "Proizvodac: " + this.proizvodac + "\nModel: " + this.model +
  20. "\nSnaga: " + this.snaga;
  21. }
  22.  
  23.  
  24. }
  25.  
  26. static void Main(string[] args)
  27. {
  28. List<Automobil> auti = new List<Automobil>();
  29. for (int i = 0; i < 5; i++)
  30. {
  31. Console.Write("Proizvodac: ");
  32. auti[i].proizvodac = Console.ReadLine();
  33. Console.Write("Model: ");
  34. auti[i].model = Console.ReadLine();
  35. Console.Write("Snaga: ");
  36. auti[i].snaga = int.Parse(Console.ReadLine());
  37. }
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement