4条回答
代码的灵魂是bug! 2016-12-04 15:19关注供参考
import java.util.Scanner; public class AA { static B b = new B(); /** * @param args */ public static void main(String[] args) { Scanner s = new Scanner(System.in); int x = s.nextInt(); if (x > b.get()) { System.out.println("大了"); } else if (x < b.get()) { System.out.println("小了"); } else { System.out.println("猜对了"); } } } class B { public int v = 100; public int get() { return v; } }本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
