美文网首页
2018-12-19第14次作业

2018-12-19第14次作业

作者: 头有点铁的愣头青 | 来源:发表于2018-12-19 15:14 被阅读0次

int[] shuzi1 = { 18,25,7,36,13,2,89,63};
int min = 0;//用来储存最小的值
int xb = 0;//用来储存最小值的下标
int[]shuzi2 =new int[shuzi1.Length];//保存原始的数组
Array.Copy(shuzi1, shuzi2, shuzi1.Length);
Array.Sort(shuzi1);//找出最小值
min = shuzi1[0];
xb = Array.IndexOf(shuzi2, min);

              Console.WriteLine("最低积分是{0},在数组中的原始位置是{1}",min,xb);

        
        Console.ReadKey();

相关文章

网友评论

      本文标题:2018-12-19第14次作业

      本文链接:https://www.haomeiwen.com/subject/srejkqtx.html