运行 ❯
获取您的网站
×
更改方向
更改主题、深色/浅色
前往 Spaces
#include <stdio.h> int main() { // A variable with some specific numbers int numbers = 12345; // A variable to store the reversed number int revNumbers = 0; // Reverse and reorder the numbers while (numbers) { // Get the last number of 'numbers' and add it to 'revNumber' revNumbers = revNumbers * 10 + numbers % 10; // Remove the last number of 'numbers' numbers /= 10; } // Output the reversed numbers printf("%d", revNumbers); return 0; }
54321