pyp2001
#include <stdio.h>
#include<stdlib.h>

int main()
{
    int n;
    int a[32];
    scanf("%d", &n);

    int i = 0;
    while (n > 0)
    {
        a[i++] = n & 1;
        n = n >> 1;
    }
    while (i--)
    {
        printf("%d", a[i]);
    }
    printf("\n");

    system("pause");
    return 0;
}

运行结果如下:

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-01-02
  • 2022-02-02
  • 2021-12-01
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-29
  • 2022-01-09
  • 2021-09-04
  • 2021-08-11
相关资源
相似解决方案