提交时间:2023-05-11 21:49:22

运行 ID: 17094

#include<bits/stdc++.h> using namespace std; void shi_to_er(int x) { int num[10]; int cnt = 0; for (int i = 0; i < 5; i++) { num[cnt++] = x % 2; x /= 2; } for (int i = 4; i >= 0; i--) { cout << num[i]; } cout << endl; } int main() { for (int i = 0; i <= 31; i++) { shi_to_er(i); } return 0; }