2018-12-06

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication2

{

? ? class Program

? ? {

? ? ? ? static void Main(string[] args)

? ? ? ? {

? ? ? ? ? ? try

? ? ? ? ? ? {

? ? ? ? ? ? ? ? Console.WriteLine("請輸入4家店的價(jià)格");

? ? ? ? ? ? ? ? int[] money = new int[4];

? ? ? ? ? ? ? ? for (int n = 0; n < money.Length; n++)

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? Console.WriteLine("請輸入第{0}店的價(jià)格:", n + 1);

? ? ? ? ? ? ? ? ? ? money[n] = Convert.ToInt32(Console.ReadLine());

? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? int a = 10000000;

? ? ? ? ? ? ? ? for (int i = 0; i < money.Length; i++)

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? if(money[i]<a)

? ? ? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? a = money[i];

? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? }

? ? ? ? ? ? }

? ? ? ? ? ? catch

? ? ? ? ? ? {

? ? ? ? ? ? ? ? Console.WriteLine("你輸入的格式錯(cuò)誤");

? ? ? ? ? ? }

? ? ? ? ? ? Console.ReadKey();

? ? ? ? }

? ? }

}

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • using System; using System.Collections.Generic; using Sys...
    追魂_409e閱讀 149評(píng)論 0 0
  • #代碼 using System; using System.Collections.Generic; using...
    柏建春閱讀 256評(píng)論 0 0
  • 作業(yè)1需求image.png try { double[] price = new d...
    晨顏閱讀 205評(píng)論 0 0
  • 知識(shí)點(diǎn): 注:int類型默認(rèn)32位有大小范圍 且第一位為符號(hào)位 0 為正 1 為負(fù) 8.4作業(yè) A:1、風(fēng)力預(yù)警系...
    cGunsNRoses閱讀 1,179評(píng)論 0 0
  • 文/剪甯 目 錄 | 【歷史仙俠】《仙旅三國》簡介&目錄 上一章 | 【歷史仙俠】仙旅三國 (59) 下一章 ...
    剪甯閱讀 2,279評(píng)論 57 51

友情鏈接更多精彩內(nèi)容