JAY
在实践中进步!

今天 编写程序,遇到了 "成员名称不能与它们的封闭类型相同",代码如下:
如果有人知道,请解答!

 1using System;
 2using System.Collections.Generic;
 3using System.Text;
 4
 5namespace judge
 6{
 7    class Judge
 8    {
 9       string  Judge(int a)
10        {
11            string  d;
12            int c = 0;
13            for (int i = 1; i <= a; i++)
14            {
15                int b = a % i;
16                if (b == 0)
17                {
18                    
19                    c++;
20                                   
21                }

22                                               
23            }

24           if (c > 2)
25                {
26
27                    d = "不是素数!";
28
29
30                }

31                else
32                {
33                    d = "是素数!";
34                
35                }

36
37         return d;
38        
39        }

40        static void Main(string[] args)
41        {
42            string x = Console.ReadLine();
43            int ni = int.Parse(x);
44            Judge newj = new Judge();
45            Console.WriteLine(newj.Judge(ni));
46           
47
48        }

49    }

50}

51
52
请高人指点!
posted on 2007-06-15 21:55  jay tian  阅读(6200)  评论(4)    收藏  举报