int max = 0; string input = ""; for (int i = 1; i <= 10; i++) { Console.WriteLine("Please input #{0}:", i); input = Console.ReadLine(); if (Convert.ToInt32(input) > max) { max = Convert.ToInt32(input); } } Console.WriteLine(max.ToString());
static void Main(string[] args) { int max = int.MinValue, In = 0; for (int i = 0; i < 10; i++) { In = Convert.ToInt32(Console.ReadLine()); if (max < In) max = In; } Console.WriteLine(max.ToString()); }
List<int> list = new List<int>(); for (int i = 0; i <= 10; i++) { int num = Int32.Parse(Console.ReadLine()); list.Add(num); }
Console.WriteLine("最高分是:"+list.Max());
decimal max=0; for (int i = 1; i <= 10; i++) { Console.WriteLine("{0}", i); input = Console.ReadLine(); if (decimal.TryParse(input,out max)) { max = decimal.Parse(input); } } Console.WriteLine(max.ToString());
int max=0; int a=0; for(int i=0;i<10;i++) { console.WriteLine("请输入第{0}个数:",i); a=int.parse(console.ReadLine()); if(a>max) { max=a; } } console.WriteLine(max); console.ReadLine();
string input = "";
for (int i = 1; i <= 10; i++)
{
Console.WriteLine("Please input #{0}:", i);
input = Console.ReadLine();
if (Convert.ToInt32(input) > max)
{
max = Convert.ToInt32(input);
}
}
Console.WriteLine(max.ToString());
{
int max = int.MinValue, In = 0;
for (int i = 0; i < 10; i++)
{
In = Convert.ToInt32(Console.ReadLine());
if (max < In)
max = In;
}
Console.WriteLine(max.ToString());
}
List<int> list = new List<int>(); for (int i = 0; i <= 10; i++)
{
int num = Int32.Parse(Console.ReadLine());
list.Add(num);
}
Console.WriteLine("最高分是:"+list.Max());
for (int i = 1; i <= 10; i++)
{
Console.WriteLine("{0}", i);
input = Console.ReadLine();
if (decimal.TryParse(input,out max))
{
max = decimal.Parse(input);
}
}
Console.WriteLine(max.ToString());
int a=0;
for(int i=0;i<10;i++)
{
console.WriteLine("请输入第{0}个数:",i);
a=int.parse(console.ReadLine());
if(a>max)
{
max=a;
}
}
console.WriteLine(max);
console.ReadLine();