import java.io.*;class horse
{
int setcolor(int col)
{
return 625356-col;
}
int getcolor(int col)
{
return setcolor(col);
}
}
class mr
{
public static void main(String args[])
{
int ot;
horse hr;
hr=new horse();
try
{
System.out.println("Äã±ØÐèÊäÈëÒ»¸öÕûÊý£º");
//ÐÞ¸Ä
String str;
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
str=in.readLine();
int cc = Integer.parseInt(str);
//end
ot=hr.getcolor(cc);
System.out.println(ot);
System.out.println(System.currentTimeMillis());
}
catch(Exception e)
{}
}
}
{
int setcolor(int col)
{
return 625356-col;
}
int getcolor(int col)
{
return setcolor(col);
}
}
class mr
{
public static void main(String args[])
{
int ot;
horse hr;
hr=new horse();
try
{
System.out.println("Äã±ØÐèÊäÈëÒ»¸öÕûÊý£º");
//ÐÞ¸Ä
String str;
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
str=in.readLine();
int cc = Integer.parseInt(str);
//end
ot=hr.getcolor(cc);
System.out.println(ot);
System.out.println(System.currentTimeMillis());
}
catch(Exception e)
{}
}
}
解决方案 »
- 一段代码,两个类之间
- 本人18号要去参加scjp考试 有几道题不会请前辈指点一下!
- 一个简单的问题,解决一下.我刚学JAVA的.
- 求java编程思想的课后题答案,找了一天了都没找到
- JAVA怎样计算两个日期之间的差
- 新手再次提问,人笨真是没办法:(
- 大家来比较一下swt和swing吧!
- java applet问题
- java程序解释问题----最先解决的得分
- 如何用Java建一个目录呀?就是实现Dos的MD命令。多谢!!
- 如何将一String字符串里的"\n"替换成"<br>"?这是为了在表单的多行文本书写时和显示时的格式是样的?不要使用<pre></pre>,因为那样不能自动
- 谁能给我具体的说说JNDI!100分送上
{
int setcolor(int col)
{
return 625356-col;
}
int getcolor(int col)
{
return setcolor(col);
}
}
class mr
{
public static void main(String args[])
{
String cc;
int ot;
horse hr;
hr=new horse();
try
{
System.out.println("你必需输入一个整数:");
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
cc=in.readLine();
ot=hr.getcolor(Integer.parseInt(cc));
System.out.println(ot);
System.out.println(System.currentTimeMillis());
}
catch(Exception e)
{}
}
}
这里要改成
BufferReader br = new BufferReader(new InputStreamReader(System.in));
String line = br.readLine();
cc = Integer.parseInt(line);
System.out.println("你必需输入一个整数:");
cc=System.in.read();
System.out.println("输入了:" + cc);
读到的是第一个字符的ascii数值
56/57地一个都是'5' ascii = 53
所以得到6253032ascii = 50
所以得到625306
我试了试,的确是只读入了一个byte,所以他的值永远都不会大于255,天那!我终于明白了!太谢谢各位了!