/**Main.java**Createdon2007年4月14日,下午5:15**Tochangethistemplate,chooseTools|TemplateManager*andopenthetemplateintheeditor.*/packagejavaapplication1;/****@authorhch*/p...
/*
* Main.java
*
* Created on 2007年4月14日, 下午5:15
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package javaapplication1;
/**
*
* @author hch
*/
public class Main {
/** Creates a new instance of Main */
public Main() {
}
/**
* @param args the command line arguments
*/
public static void main (String[] args) throws Exception
{
// TODO code application logic here
int 中1=System.in.read();
int 中2=System.in.read();
System.out.print((char)中1);
System.out.print((char)中2);
}
}
/*
我打算输入一个中文字符并显示,于是写了上面的程序,但结果并不如我想象的输出中文字符,显示了两个乱码,所以想请问大家怎么将输入中文字符并输出
*/
回 天之魔神:定义成字符型要用什么输入函数,用read()会出错
展开