zoukankan      html  css  js  c++  java
  • 猴子

    /*
     * Created by SharpDevelop.
     * User: Administrator
     * Date: 2018/10/17
     * Time: 21:59
     * 
     * To change this template use Tools | Options | Coding | Edit Standard Headers.
     */
    using System;
    
    namespace c猴子
    {
    	class Program
    	{
    		public static void Main(string[] args)
    		{
    			//int n=Convert.ToInt32(Console.ReadLine ());
    			//int count=1;
    			//for (int i = n-1; i >=1; i--) {
    				count=(count+1)*2;
    			//}
    				
    			//Console.WriteLine(count);
    			string str=Console.ReadLine();
    			string[]strArray=str.Split(' ');
    			int []numArray=new int[strArray.Length];
    			for (int i = 0; i < strArray; i++) {
    				numArray[i]=Convert.ToInt32(strArray[i]);
    			}
    			int min=numArray[0];
    			int minIndex=0;
    			for (int i = 1; i < numArray.Length; i++) {
    				if(numArray[i]<min){
    					minIndex=i;
    					min=numArray[i];
    				}
    	
    			}
    			//把最小的数字和索引为0的位置的数字进行交换
    			int temp=numArray[0];
    			numArray[0]=numArray[minIndex];
    			numArray[minIndex]=temp;
    			for (int i = 0; i < numArray.Length; i++) {
    				Console.WriteLine(numArray[i]);
    			}
    			
    			// TODO: Implement Functionality Here
    			
    			Console.Write("Press any key to continue . . . ");
    			Console.ReadKey(true);
    		}
    	}
    }
    
  • 相关阅读:
    shell 逻辑操作符
    shell 整数
    shell 字符串
    常用文件测试操作符
    系统级脚本 rpcbind
    shell 特殊字符
    redhat7.5 升级OpenSSH_7.8p1
    kubernetes 项目
    salt 安装kubernetes集群3节点
    web应用
  • 原文地址:https://www.cnblogs.com/llhhcc/p/9807636.html
Copyright © 2011-2022 走看看