huiwen.java
来自「实现回文」· Java 代码 · 共 29 行
JAVA
29 行
package huiwen;
import java.io.UnsupportedEncodingException;
import javax.swing.JOptionPane;
import javax.swing.JOptionPane;
public class Huiwen {
public static void main(String argc[]) throws UnsupportedEncodingException
{
String w;
w=JOptionPane.showInputDialog("请输入字符串");
char[] q1= w.toCharArray();
double st =System.nanoTime();
for(int i=w.length()-1;i>=0;i--)
{
System.out.print(q1[i]);
}
double et=System.nanoTime();
double x=et-st;
System.out.println();
System.out.println(et);
System.out.println(st);
System.out.println("时间是"+x+"纳秒=1000微秒=1000000纳秒");
System.out.println(w);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?