我提交的ACM题库的答案

最近园子里流行做俄罗斯乌拉尔大学在线题库我也就做了一下,下面是1000题和1001题的代码:
Problem 1000:
1int main()
2{
3    int a, b;
4    clrscr();
5    scanf("%d %d"&a, &b);
6    printf("%d", a+b);
7}
Problem 1001:
 1using System;
 2using System.Threading;
 3using System.Globalization;
 4
 5namespace ConsoleApplication4
 6{
 7    class Program
 8    {
 9        static void Main(string[] args)
10        {
11            // 注意下面一行代码,如果少了的话,你永远也通过不了,哈哈
12            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
13            string[] inputArray = Console.In.ReadToEnd().Split();
14            for (int i = inputArray.Length - 1; i >= 0; i--)
15            {
16                if (!String.IsNullOrEmpty(inputArray[i]))
17                {
18                    Console.WriteLine("{0:F4}", Math.Sqrt(Convert.ToDouble(inputArray[i])));
19                }

20            }

21        }

22    }

23}
原因是什么,在这里有人解释了,注意看回复的第二楼。

posted on 2008-07-05 23:20  啊不才  阅读(963)  评论(0编辑  收藏  举报

导航