0918,练习题

一,把两个数组里面的数,转换成一个int类型 并合并在一起

 

//int[] shu = new int[] { 1, 2, 3 };            

//int[] zu = new int[] { 4, 5, 6 };            

//string[] a = new string[shu.Length + zu.Length];

           

//for (int c = 0; c < shu.Length; c++)            

//{            

//    a[c] = shu[c].ToString();

           

//}            

//for (int b = 0; b < zu.Length; b++)            

//{            

//    a[b+shu.Length] = zu[b].ToString();

           

//}

           

//for (int i = 0; i < a.Length; i++)            

//{             //Console.WriteLine(a[i]);            

//}

 

二 ,输入有几个人,然后循环着出,然后输入每一个人的分数,存在数组里,找到最高分和最低分

 

//Console.Write("请输入人数:");            

//int renshu = int.Parse(Console.ReadLine());

           

//int[] fenshu = new int [renshu];

 

           

//    for (int i = 0; i < renshu; i++)            

//    {            

//        Console.Write("请输入第" + (i+1) + "个人的分数");            

//        fenshu[i]=int.Parse(Console.ReadLine());

           

//    }            

//    for (int s = 0; s < renshu; s++)            

//    {            

//        for(int b=s;b<renshu-1;b++)            

//        {            

//            if (fenshu[s] < fenshu[b + 1])            

//            {            

//                int a = fenshu[s];                                       

//                fenshu[s] = fenshu[b + 1];            

//                fenshu[b + 1] = a;                                                                

//            }            

//        }            

//    }            

//    Console.WriteLine("最高分是" + fenshu[0]);            

//    Console.WriteLine("最低分" + fenshu[renshu - 1]);

 

 

三。 99乘法表

 

//Console.WriteLine("99乘法表");

           

//int a;

           

//for (int j = 1; j < 9; j++)            

//{            

//    for (int i = 1; i <= j; i++)            

//    {            

//        a =  j*i ;            

//        Console.Write(j + "*" + i + "=" + a + "\0");                           

//        if(j==i)            

//        {            

//            Console.WriteLine();

           

//        }                                                              

//    }                                    

//}

 

 

            //    Console.ReadLine();

posted @ 2015-09-20 09:05  jlhea  阅读(97)  评论(0编辑  收藏  举报