常用十题
1、九九乘法表:
public class chengfa {
xiaoxinpublic static void main(String[] args) {
2013江西高考英语
int i,j;
System.out.println("9*9 乘法表如下: ");
for(i=1;i<=9;i++)
{
for(j=1;j<=i;j++)
{
System.out.print(+i+"*"+j+"="+i*j);
System.out.print(" " );
}
System.out.println( );
}
}
}星村麻衣
啜泣2、成绩判断
import java.util.Scanner;
public class chengjipanduan {
public static void main(String[] args) {
int grade;
System.out.println(" 输入你的成绩: ");
Scanner s=new Scanner(System.in);
Int();
switch(grade/10)
mad world adam lambert{
ca 10:
ca 9:
System.out.println(" 你的成绩为优 ");break;
ca 8:
System.out.println(" 你的成绩为良 ");break;
ca 7:
System.out.println(" 你的成绩为中 ");break;
ca 6:
System.out.println(" 你的成绩为及格 ");break;
ca 5:
ca 4:
ca 3:
ca 2:
ca 1:
ca 0:
System.out.println(" 你的成绩为差 ");break;
}
}
}
3、矩形类
public class Rectangle {
phildouble width=1.0;
double height=1.0;
public Rectangle(double width,double height)
工作时间英文
{
this.width=width;
this.height=height;
}
public void twidth(double width)
{
this.width=width;
}
public double getwidth(double widtht)
{
return width;
}
public void theight(double height)
{
this.height=height;
四级成绩短信查询}
public double getheight(double height)
{
return height;
}
public double getArea()
{
einstein
return width*height;
}
public double getperimeter()
{
return 2*(width+height);
}
}
import tixing06.Rectangle;
public class TestRectangle {
public static void main(String[] args)
{
Rectangle r=new Rectangle(4,40);
System.out.println(" 矩形面积为 "+r.getArea()+" 周长为 "+r.getperimeter());
}
}
宝宝怎么添加辅食4、两数对换
package tixing;
import java.util.Scanner;
public class TiXing02 {
public static void main(String[] args) {
int a,b;
System.out.println(" 输入两个数 a 和 b:");
Scanner s=new Scanner(System.in);
Int();
Scanner k=new Scanner(System.in);
Int();
System.out.println(" 两个数为 :a="+a+" b="+b );
exchange(a,b);
}
public static void exchange(int a,int b)
{
int t;
t=a;a=b;b=t;
System.out.println(" 交换后两个数为 :a="+a +" b="+b );
}
}
5、数组
import java.util.Scanner;
import java.util.Random;
public class shuzu {
public static void main(String[] args) {
int n,i,j,k;
double ave=0;
System.out.println(" 输入数组长度: ");
Scanner s=new Scanner(System.in);
Int();
int a[]=new int[n];
System.out.println(" 输入的原数组为: ");
for(i=0;i<n;i++)
{
a[i]=(int)(Math.random()*10+1);
System.out.printf("%4d",a[i]);
}
for(i=0;i<n;i++) {
for(j=i+1;j<n;j++)
{
if(a[j]>a[i])
{
k=a[i];a[i]=a[j];a[j]=k;
}
}