博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
第三次过程性考核
阅读量:7046 次
发布时间:2019-06-28

本文共 1279 字,大约阅读时间需要 4 分钟。

码云:https://gitee.com/xiaoshishuya/events

7-1 简化的插入排序

import java.util.*;public class Main{    public static void main(String[] args){        Scanner read=new Scanner(System.in);        int n=read.nextInt();        int a[]=new int[n+1];//定义一个数组        int i;//定义整型i        for(i=0;i

运行结果:

 

7-2 IP地址转换

运行结果:

 

7-4 交换最小值和最大值

import java.util.*;public class Main {    public static void main(String[] args){        Scanner x=new Scanner(System.in);        int N=x.nextInt();//定义数        int a[]=new int[N];//定义数组        for(int i=0;i
a[max]){ max=i; } } int c=a[max]; a[max]=a[N-1]; a[N-1]=c; for(int i=0;i

运行结果:

7-5 说反话-加强版

import java.io.IOException;  import java.text.ParseException;  import java.util.Scanner;    public class Main {    public static void main(String[] args) throws ParseException, IOException {      Scanner scanner = new Scanner(System.in);      String str = scanner.nextLine().trim();//返回整行,去掉字符串两端的空格      String[] strs = str.split(" ");//  把字符串以空格为区隔分割字符串    for(int i=strs.length-1;i>=0;--i)  //循环    {          System.out.print(strs[i]);          if(i!=0)  //if语句判断          System.out.print(" ");      }    }}

运行结果:

 

 

转载于:https://www.cnblogs.com/xiaoshishuya/p/9905834.html

你可能感兴趣的文章
asp.net中JQuery AJAX的解决方案
查看>>
像素与rem转换
查看>>
urlencode遇到中文编码问题
查看>>
MpVue解析
查看>>
AngularJS学习之 ngTable 翻页 功能以及利用angular service准备测试数据
查看>>
Newtonsoft.Json随手记
查看>>
关于“Adobe After Effects 2018安装后没法找到自动跟踪菜单 ”的解决方法
查看>>
go学习笔记(05)-基本语法-常量
查看>>
创建spring自定义注解进行自动装配
查看>>
如何使用DotfuscatorPro_4.9对软件进行加密
查看>>
2018/11/30 一个64位操作系统的实现 第三章 loader程序的导入
查看>>
python wsgi PEP333 中文翻译
查看>>
收费udx
查看>>
构造函数+原型的js混合模式
查看>>
[文章笔记] Wanted: Best Practices for Collaborative Translation (2011)
查看>>
SEO优化网页伪静态的生成方式和伪静态的用处
查看>>
Every thing begin with save my time.
查看>>
win10专业版激活方法
查看>>
关于channel的一些坑
查看>>
对于返回void类型的asyc的异步方法,如何修改,能使用await
查看>>