我提交的ACM题库的答案
最近园子里流行做俄罗斯乌拉尔大学在线题库我也就做了一下,下面是1000题和1001题的代码:
Problem 1000:
Problem 1000:
1
int main()
2
{
3
int a, b;
4
clrscr();
5
scanf("%d %d", &a, &b);
6
printf("%d", a+b);
7
}
Problem 1001:![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
1
using System;
2
using System.Threading;
3
using System.Globalization;
4![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
5
namespace 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
}
原因是什么,在这里有人解释了,注意看回复的第二楼。![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
8
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
9
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
10
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
11
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
12
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
13
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
14
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
15
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
16
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
17
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
18
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
19
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
20
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
21
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
22
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
23
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)