- เข้าสู่ระบบล่าสุด
- 2011-10-20
- เวลาออนไลน์
- 37 ชั่วโมง
- จิตพิศัย
- 64
- Money
- 51
- สมัครสมาชิกเมื่อ
- 2009-12-20
- สิทธิ์ในการอ่าน
- 200
- โพสต์
- 136
- กระทู้
- 45
- สำคัญ
- 0
- เครดิต
- 64
- UID
- 2
  
- Money
- 51
- จิตพิศัย
- 64
- สมัครสมาชิกเมื่อ
- 2009-12-20
- เครดิต
- 64
- โพสต์
- 136
|
การคำนวณหาพื้นที่สี่เหลี่ยมผืนผ้า แต่มีข้อจำกัดว่าผู้ใช้โปรแกรมต้องป้อนความกว้างไม่เกิน 20 และความยาวไม่น้อยกว่า 30 รวมไปถึงความกว้างและความยาวห้ามเท่ากัน อีกอย่างคือ ความยาวต้องมากกว่าความกว้าง
- Module area
- Dim inwide, inlong, area As Integer
- Sub Main()
- Console.Write("Input Wide : ")
- inwide = Console.ReadLine()
- Console.Write("Input Long : ")
- inlong = Console.ReadLine()
- If inwide <= 20 AndAlso inlong >= 30 AndAlso inwide <> inlong AndAlso inwide < inlong Then
- area = inwide * inlong
- Console.WriteLine("Area = " & area)
- Else
- Console.WriteLine("Long or Wide incorrect")
- End If
- End Sub
- End Module
คัดลอกไปที่คลิปบอร์ด
ผลรัน
ผลรันเมื่อไม่ตรงตามเงื่อนไข
|
|