很强啊。我想半天Main不知道该怎么写呢

所以才叫你全部贴出来的

我是初学者,希望大家能多多帮助我
很强啊。

2005-05-13 11:18
using System;
namespace ConsoleApplication2 { /// <summary> /// Class1 的摘要说明。 /// </summary> class Class1 { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main(string[] args) { int sum=0; Console.WriteLine("判断积偶"); int n=int.Parse(Console.ReadLine()); if(n%2==1) { for(int a=1;a<=n;a+=2) { sum+=a; } Console.WriteLine("{0}",sum); } else { for(int b=2;b<=n;b+=2) { sum+=b; } Console.WriteLine("{0}",sum); } System.Threading.Thread.Sleep(1000); } }
} 我只能想出这样的来。
你那种思维我很想学的。

2005-05-13 11:29
2005-05-13 11:47

2005-05-13 11:58
2005-05-13 13:06

2005-05-13 13:07
很强啊。
我想半天Main不知道该怎么写呢
所以才叫你全部贴出来的

2005-05-13 17:11


2005-05-14 20:33
很强啊。
我想半天Main不知道该怎么写呢
所以才叫你全部贴出来的

2005-05-14 23:37