统计信息

  • 访问数:12136
  • 博客数:142
  • 建立时间:2008-01-05
  • 更新时间:2008-05-21
我叫王超然,是一名电脑爱好者,现在在新加坡留学上高一.我立志成为一名电脑人才,愿意在这里与大家一同分享我玩转电脑的心得.O-level华文考了A-One哈哈!

P3Q12

2008-01-31 12:51:24

天气: 晴朗 心情: 高兴

/*P3Q12
 * Wang Chaoran
 * Description:12 (Finding the smallest n such that n2 > 12000)
Use a while loop to find the smallest integer n such that n is greater than 12,000.
*/
public class P3Q12
{
  public static void main(String[] args)
  {
    int n=1;
    //Compute the smallest integer n such that n is greater than 12,000.
    while(n*n<=12000)
    {
      n++;
    }
    //Print the output
    System.out.println("The smallest integer n such that n is greater than 12,000 is: "+n);
  }
}
加入收藏 编辑 审核

TAG: computing

我来说两句

OPEN

Powered by X-Space 1.2 © 2001-2006 Comsenz Technology Ltd