1题:
public static void main(String[] args) throws Exception{
// TODO Auto-generated method stub
BufferedReader b=new BufferedReader(new InputStreamReader(System.in));
System.out.println("请输入:");
char c[]=new char[1024];
int i=0;
try {
i=b.read(c);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String s=new String(c,0,i);
Num num=new Num();
num.show(s);
}
class Num{
public void show(String ss){
StringBuffer str=new StringBuffer(ss);
System.out.println("逆序的结果为:"+str.reverse());
}
}
2.题 类似第一题。只是用你到Math.PI把圆周率求出来算一下就可以了。
题目呢 有木有
meiyou