Lỗi khi chạy chương trình (Index was outside the bounds of the array)
mọi người cho e hỏi chỗ này sửa thế nào ạ. e học LT hướng đối tượng. mỗi lần chạy nhập số lượng 1 thì báo lỗi ngay còn nhập số lượng lớn thì tới lần gần cuối nó mới báo lỗi. mong đc giải đáp.
First: Why two threads for the same question?
Second: Computers count from 0 to n-1, while humans count from 1 to n. That’s the difference and also the reason for the “Index was outside the array” error message. Think about it, and you’ll find the programming error.
1 Like