zoukankan      html  css  js  c++  java
  • 十进制转二进制

    void conversion()
    {
        Stack S;
        int n;
        InitStack(&S);
        printf("Please input a number to convert:
    ");
        scanf("%d",&n);
        if(n<0)
        {
            printf("The number must be over 0");
            return 0;
        }
        if(n==0)
        {
            Push(&S,n%2);
            n=n/2;
        }
        printf("The result is");
        while(!StackEmpty(&S))
        {
            printf("%d",Pop(&S));
        }
    }
  • 相关阅读:
    iOS
    iOS
    ios
    iOS
    ios
    ios
    iOS
    ios
    常用NSString的方法
    instancetype
  • 原文地址:https://www.cnblogs.com/claudia529/p/11103531.html
Copyright © 2011-2022 走看看