課程
/后端開發(fā)
/C#
/C#開發(fā)輕松入門
然后
數(shù)位123
2016-08-05
源自:C#開發(fā)輕松入門 6-1
正在回答
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? int N = 3, temp;
? ? ? ? ? ? int[] arr = new int[N];
? ? ? ? ? ? for (int i = 0; i < N; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? arr[i] = int.Parse(Console.ReadLine());
? ? ? ? ? ? }
? ? ? ? ? ? for (int i = 0; i < N - 1; i++)
? ? ? ? ? ? ? ? for (int j = 0; j < N - i - 1; j++)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? if (arr[j + 1] < arr[j])
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? temp = arr[j];
? ? ? ? ? ? ? ? ? ? ? ? arr[j] = arr[j + 1];
? ? ? ? ? ? ? ? ? ? ? ? arr[j + 1] = temp;
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? Console.Write(arr[i]);
? ? ? ? ? ? Console.Write("最大的數(shù)為{0}", arr[N - 1]);
? ? ? ? }
? ? }
}
舉報
本門課程是C#語言的入門教程,將帶你輕松入門.NET開發(fā)
5 回答求大神幫忙解答
1 回答哪位大神幫幫忙,求解
1 回答大神幫忙看看哪里出錯了?
2 回答大神,幫忙看一下哪兒錯了
2 回答沒看出有什么問題,大家?guī)兔纯?/p>
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學習伙伴
掃描二維碼關注慕課網(wǎng)微信公眾號
2016-08-05
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? int N = 3, temp;
? ? ? ? ? ? int[] arr = new int[N];
? ? ? ? ? ? for (int i = 0; i < N; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? arr[i] = int.Parse(Console.ReadLine());
? ? ? ? ? ? }
? ? ? ? ? ? for (int i = 0; i < N - 1; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? for (int j = 0; j < N - i - 1; j++)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? if (arr[j + 1] < arr[j])
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? temp = arr[j];
? ? ? ? ? ? ? ? ? ? ? ? arr[j] = arr[j + 1];
? ? ? ? ? ? ? ? ? ? ? ? arr[j + 1] = temp;
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? for (int i = 0; i < N; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Console.Write(arr[i]);
? ? ? ? ? ? }
? ? ? ? ? ? Console.Write("最大的數(shù)為{0}", arr[N - 1]);
? ? ? ? }
? ? }
}