Categories
Medium Problems

โจทย์ข้อที่ MX0032

จงเขียนฟังก์ชั่นที่รับค่าเข้าไป อาจจะเป็น integer หรือ string แล้วส่งข้อความ “int” ออกมาถ้าข้อมูลที่ส่งเข้าไปเป็น integer และให้ส่งข้อความ “str” ออกมาถ้าค่าที่รับเข้าไปเป็น string ถ้าไม่เข้าสองเงื่อนไขนี้ให้ส่งค่า “” ออกมา

Examples

intorstring(8) ➞ “int”

intorstring(“hello”) ➞ “str”

Leave a Reply