#include <iostream> using namespace std; string Change(int n){ //十进制转二进制,得到二进制的字符串保存在res中 string res; while(n != 0){ res.push_back(n % 2 + '0'); //整型数字转换为字符型数字 n = n / 2; } //十进制转二进制过程中先得到的数值为低位,因此遍历时要从字符串的末尾即高位开始遍历 string str = ""; for(int i = res....