lesson 47

This commit is contained in:
Alexander Zhirov 2021-09-07 17:21:20 +03:00
parent 4bebb5b445
commit c4761a5ee6
1 changed files with 11 additions and 12 deletions

View File

@ -16,8 +16,7 @@ int main()
cin >> n; cin >> n;
cout << "Число " << n << " в двоичной системе счисления: "; cout << "Число " << n << " в двоичной системе счисления: ";
for (int i = 7; i >= 0; --i) for (int i = 7; i >= 0; --i) {
{
int degree = pow(2, i); int degree = pow(2, i);
cout << (n >= degree) << (i == 4 ? " " : ""); cout << (n >= degree) << (i == 4 ? " " : "");
if (degree <= n) if (degree <= n)