自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 收藏
  • 关注

原创 第三章 输出满足1+2+3+...n<8888的最大正整数n 。

public class Test9{ public static void main(String args[]) { int n=1; long s=0; System.out.println("1+2+3.....+n<8888的最大正整数n:"); while(true) { s=s+n; n++; if(s>=8888)

2017-10-27 14:08:15 4952 1

原创 第三章 用for语句计算8+88+888+。。。前10项之和

public class Test8{ public static void main(String args[]) { long s=0,a=8,item=a,i=1,n=10; System.out.println("8+88+888...前10项之和:"); for(i=1;i<=n;i++) { s=s+item; item=item*10

2017-10-27 13:55:38 2044 1

原创 第三章 求100以内的所有完数

public class Test7{ public static void main(String args[]) { int s=0; int i,j; for(i=1;i<=1000;i++) { for(j=1,s=0;j<i;j++) { if(i%j==0) s=s+j; } if(s==i) System

2017-10-27 13:39:38 2116

原创 第三章 求1!+1/2!+1/3!+1/4!+....的前20项和

public class Test6{ public static void main(String args[]) { double s=0,a=1,i=1; do{s=s+a; i++; a=(1.0/i)*a; } while(i<=20); System.out.println("使用do-while循环计算的

2017-10-27 13:28:56 2005

原创 第三章 求100以内的素数

public class Test5{ public static void main(String args[]) { int a=1; for(int i=2;i<=100;i++) { for(int j=2;j<i;j++) { a=i%j; if(a==0) break; } if(a!=0) System.o

2017-10-27 12:35:18 580

原创 第三章 求1!+2!。。。。。。+10!

public class Test4{ public static void main(String args[]) { int i;int s=1; for(i=1;i<=10;i++) { s=i*s; } System.out.println("s="+s); } } 运行截图:

2017-10-27 12:12:21 332

原创 第二章 输出全部的希腊字母

public class Test3{ public static void main(String args[]) { char a,b; a='α';b='ω'; System.out.println("希腊字母表"); for(;a<=b;a++) { System.out.println(a+""); }

2017-10-27 11:52:23 893

原创 第二章 作业 汉字你、我、他在unicode表中的位置。

public class Test2{ public static void main(String[] args) { char a='你',b='我',c='他'; System.out.println("汉字\'你'在unicode表中的位置:"+(int)a); System.out.println("汉字\'我'在unicode

2017-10-27 11:25:46 1358

原创 hello world 作业

代码: public class Test{ public static void main(String[] args){ System.out.println("Hello World"); } } 运行截图:

2017-09-23 09:54:29 489

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除