Java开发中经典的小实例-(字符串倒序输出)
public class Test12 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
System.out.println("请输入一个字符串:");
String str = input.next();
for (int i = str.length() - 1; i >= 0; i--) {
char ch = str.charAt(i);
System.out.print(ch);
}
}
}
Java开发中经典的小实例-(字符串倒序输出)的更多相关文章
- Java开发中经典的小实例-(字符串比较)
//输入字符串然后与自己定义的数组进行对比,并输出重复次数. public class Test11 { public static void main(String[] args) { ...
- Java开发中经典的小实例-(二分法)
public int binarySearch(int[] data,int aim){//以int数组为例,aim为需要查找的数 int start = 0; int end = data.leng ...
- Java开发中经典的小实例-(while(参数){})
import java.util.Scanner;public class Test_while { public static void main(String[] args) { ...
- Java开发中经典的小实例-(输入三个数字判断三角形类型)
import java.util.Scanner;public class threeTest { public static void main(String[] args) { ...
- Java开发中经典的小实例-(打印输入重复的值)
import java.util.ArrayList;import java.util.Scanner;public class Test8 { public static void main( ...
- Java开发中经典的小实例-(swich(){case:参数break;default: break;})
import java.util.Scanner;public class Test6 { public static void main(String[] args) { // ...
- Java开发中经典的小实例-(能被3整除,并且十个数换一行)
import java.util.Scanner;public class Test15 { public static void main(String[] args) { // ...
- Java开发中经典的小实例-(do{}while())
import java.util.Scanner;public class Test13 { public static void main(String[] args) { // ...
- Java开发中经典的小实例-(随机产生验证码)
import java.util.Scanner;public class Test10 { public static void main(String[] args) { // ...
随机推荐
- php课程---JavaScript与Jquery的区别(转)
jQuery能大大简化Javascript程序的编写,我最近花时间了解了一下jQuery,把我上手过程中的笔记和大家分享出来,希望对大家有所帮助.要使用jQuery,首先要在HTML代码最前面加上对j ...
- 如何获得中国所有的IP地址段
转自: https://wjianz.wordpress.com/2014/09/12/howto-%E4%BB%8Eapnic%E8%8E%B7%E5%8F%96%E4%B8%AD%E5%9B%BD ...
- python(1)
1.适配中文 #coding-utf-8 #coding: utf-8 2.格式化输出,此时的转义字符不能用\,只能用% print 'growth rate : %d \%' % 7 5 3 Tru ...
- situations where MyISAM will be faster than InnoDB
http://www.tocker.ca/categories/myisam Converting MyISAM to InnoDB and a lesson on variance I'm abou ...
- Jmeter工作原理
- HttpClient(JAVA)使用笔记
HTTPCLIENT 此工具是由apache基金会支持开发的一套 开源 http client 组件, 目前属于 http components的一部分, 官网:http://hc.apache.or ...
- luaprofiler探索
什么是luaprofiler? http://luaprofiler.luaforge.net/manual.html LuaProfiler is a time profiler designed ...
- LUA实现单词替换功能
背景描述 编程或者文档处理过程, 经常遇到需要将一个单词修改为另外一个单词的情况, 例如 命名为 shall 修改 为 should. 使用工具实现, 则比较方便,不容易出错, 解放双手. 需求规格 ...
- Web3D编程入门总结——面向对象的基础Web3D框架
本篇主要通过分析Tony Parisi的sim.js库(原版代码托管于:https://github.com/tparisi/WebGLBook/tree/master/sim),总结基础Web3D框 ...
- HTML5 webSQL 中查询结果集 result.rows.item 的用法
加入查询回调函数如下: function(tx,result){ var len = result.rows.length; var recordset = result.rows.item; ){ ...