Bài 1: Viết chương trình cho phép nhập từ bàn phím một số nguyên dương a và thực hiện: a. Cho biết a là số có mấy chữ số. b. Cho biết tổng các chữ số của a. c. Ta gọi số “đối xứng” với a là số nguyên dương thu được từ a bằng cách đảo ngược thứ tự các chữ số của a. Viết chương trình in ra số đối xứng của số nguyên dương a. d. Cho a và b là 2 số nguyên dương. Ta gọi tổng đối xứng của a và b là số đối xứng với tổng của số đối xứng với a và số đối xứng với b. Viết chương trình cho phép nhập hai số nguyên dương a, b và in ra tổng đối xứng của chúng.

Các câu hỏi liên quan

Complete the sentences, using the words in brackets plus your own additions. Use three to five words for each of the spaces provided. 1. The dodo is a flightless bird that doesn’t exist anymore. (extinct) → The dodo __________________________________________________. 2. People thought that the dodo had existed on the nearby island of Reunion before their extinction. (be) → The dodo _____________________________ on the nearby island of Reunion before their extinction. 3. Sea turtles have become an endangered species. (verge) → Sea turtles are ______________________________________. 4. The authorities have tried their best to protect sea turtles, their eggs, baby turtles and their habitat. (effort) → The authorities have ______________________________ to protect sea turtles, their eggs, baby turtles and their habitat. 5. The government specially stresses the need for protecting endangered species. (emphasis) → The government __________________________________ the need for protecting endangered species. 6. The Komodo dragon tends to live in forests, on beaches and on hill tops. (tendency) → The Komodo dragon ___________________________________ in forests, on beaches and on hill tops. 7. The number of blue whales still existing is estimated about 14,000. (estimation) → _____________________________________ 14,000 blue whales still existing. 8. Many people show little concern about animal cruelty. (indifferent) → Many people ____________________________________ animal cruelty.