画魇吧 关注:4,057贴子:37,604
  • 0回复贴,共1

1997-2016///////BAIDU/010011011

只看楼主收藏回复

  import awt.*;
  import .awt.event.*;
  import .applet.*;
  public class wangquanshu extends Applet implements ActionListener
  {
  int aa[]={6,28,496,8128,130816,2096128 ,33550336 },bb[]={0,0,0,0,0,0,0};
  add(lab1);
  add(text1);
  add(lab2);
  add(text2);
  add(but);
  but.addActionListener(this);
  }
  public void paint(Graphics g)
  {int h;
  h=50+20*m;
  g.drawString(i,10,h);
  }
  public void actionPerformed(ActionEvent e)
  {int s=0;
  m=1;
  int j=1;
  int a=Integer.parseInt(text1.getText());
  int b=Integer.parseInt(text2.getText());
  for(i=a;i<=b;i++)
  {for(j=1;j<i;j++)
  if(i%j==0) s=s+j;
  }
  if(i==s)
  m++;
  repaint();
  }
  }


来自Android客户端1楼2016-02-03 20:39回复