class star
{
public static void main(String[] args)
{
int number=Integer.parseInt(args[0]);
if (number>=1&number<=20)
{
System.out.print("1-20");
}
else if (number>20&number<=40)
{
System.out.print("21-40");
}
else if (number>40&number<=60)
{
System.out.print("41-60");
}
else if (number>60&number<=100)
{
int row,colum;
for(row=1;row<=5;row++)
{
for(colum=1;colum<=30;colum++)
{
if(row==2|row==3|row==4)
{
if(colum>3&colum<28)
{
System.out.print(" ");
}
else System.out.print("*");
}
else{
System.out.print("*");}
}
System.out.print("\n");
}
}
else System.out.print("Your intput out of rang.\nPlease Input number between 1-100.");
}
}
สมัครสมาชิก:
ส่งความคิดเห็น (Atom)
SQL count row all table in database
SELECT QUOTENAME(SCHEMA_NAME(sOBJ.schema_id)) + '.' + QUOTENAME(sOBJ.name) AS [TableName] , SUM(sPTN.Rows) AS [RowCou...
-
วิธีแก้ 1. ไปที่ Control Panel 2. ที่มุมขวาบน เลือก View by : category 3. ที่หัวข้อ Programs เลือก Uninstall a program 4. ที่แถบซ้าย...
-
Ex. 1 การคูณ .model small .stack 100h .data X equ 3 Y equ 3 Z equ 2 .code ;X+Y-2Z+1 Main pro...
-
หลักการประมวลผลไฟล์ การเขียนโปรแกรมในภาษาซี เพื่อประมวลผลกับไฟล์ หมายถึงการเขียนคำสั่งเพื่ออ่านข้อมูลจากไฟล์ หรือเขียนข้อมูลลงไฟล์นั้...
ไม่มีความคิดเห็น:
แสดงความคิดเห็น