Программа не содержит статического метода main подходящего для точки входа - C#
Формулировка задачи:
Помогите дорогие друзья! при компиляции выскакивает вот такая ошибка, помогите найти в чем проблема!! буду премного благодарна:*
программа не содержит статического метода main подходящего для точки входа
Листинг программы
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- namespace pri
- {
- class Counter
- {
- int max;
- int min;
- int current;
- public Counter(int max, int min, int current)
- {
- if (this.max < this.min || this.min > this.current || this.max < this.current)
- throw new Exception("неверно задан диапазон значений");
- this.max = max;
- this.min = min;
- this.current = current;
- }
- public int NextDigit()
- {
- current++;
- if (current > max)
- throw new Exception("выход за границы диапазона значений");
- return current;
- }
- public int PrevDigit()
- {
- current--;
- if (current < min)
- throw new Exception("выход за границы диапазона значений");
- return current;
- }
- public int Current
- {
- get
- {
- return current;
- }
- set
- {
- if (value > max || value < min)
- throw new Exception("выход за границы диапазона");
- current = value;
- }
- }
- public int Max
- {
- get
- {
- return max;
- }
- set
- {
- max = value;
- }
- }
- public int Min
- {
- get
- {
- return min;
- }
- set
- {
- min = value;
- }
- }
- }
- }
Решение задачи: «Программа не содержит статического метода main подходящего для точки входа»
textual
Листинг программы
- class ClassWithMain
- {
- public static void Main()
- {
- Counter cntr = new Counter(10, 1, 5);
- Console.WriteLine("Current: {0}", cntr.Current);
- Console.WriteLine("Next: {0}", cntr.NextDigit());
- Console.WriteLine("Previous: {0}", cntr.PrevDigit());
- Console.ReadKey();
- }
- }
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д