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 NiceTry
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("----Nhap vao nguyen lieu va km-------");
- Console.Write("Nguyen lieu : ");
- int nguyenlieu = Convert.ToInt32(Console.ReadLine());
- Console.Write("Km : ");
- int km = Convert.ToInt32(Console.ReadLine());
- xe abc = new xe(nguyenlieu,km);
- Console.WriteLine("So nguyen lieu can su dung : {0}", abc.tieuthu());
- Console.ReadKey();
- }
- }
- class xe
- {
- public xe()
- {
- }
- public int nhienlieu { get; set; }
- public int km { get; set; }
- public xe(int nhienlieu,int km)
- {
- this.nhienlieu = nhienlieu;
- this.km = km;
- }
- public long tieuthu()
- {
- return (Convert.ToInt64(this.nhienlieu * this.km));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement