PDA

View Full Version : سوال: خطا در متد main



sahel65
پنج شنبه 23 اردیبهشت 1389, 20:54 عصر
دوستان با اینکه برنامه بنظرم ایراد نداره ولی از عدم وجود متد main در برنامه خبر میده!
میتونید بگید ایراد از کجاست؟



using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication2
{
class buliding
{
public int floors;
public int area;
public int occupants;
}
class buildingdemo
{
static void main()
{
buliding house = new buliding();
buliding office = new buliding();
int areaPP;

house.occupants = 400;
house.area = 2500;
house.floors = 2;
/////
office.occupants = 25;
office.area = 4200;
office.floors = 3;
areaPP = house.area / house.occupants;
Console.WriteLine("house has:\n" + house.floors +
"floors\n" + house.occupants +
"occupants\n" + house.area +
"total area\n" + areaPP + "area per person");
Console.WriteLine();
areaPP = office.area / office.occupants;
Console.WriteLine("office has:\n " + office.floors +
" floors\n " + office.occupants +
" occupants\n " + office.area +
" total area\n " + areaPP + " area per person");

}
}
}

ali.aghdam
پنج شنبه 23 اردیبهشت 1389, 22:47 عصر
خوب دوست عزیزاز اینه که VS اصلا main رو نمیشناسه!

چطور ،خوب معلومه VS از Main به عنوان مدخل برنامه استفاده می کند

کافی main رو به Main تغییر بدید!