Định nghĩa struct BigCounter (long Value). Implicit conversion từ int sang BigCounter (Value = n). Explicit conversion từ BigCounter sang short trong khối checked (dùng checked((short)Value), nếu tràn ném OverflowException). Đọc int n, tạo BigCounter b = n (implicit), thử (short)b trong try/catch: in 'OVERFLOW' hoặc giá trị.
Một dòng: số nguyên n.
-2^31 <= n <= 2^31 - 1.
Một dòng: (short)b hoặc 'OVERFLOW'.
Ví dụ:
Đầu vào:
100
Đầu ra:
100
Giải thích:
Đang tải editor...