zoukankan      html  css  js  c++  java
  • 逻辑运算符使用分析

    1.#include <stdio.h>

    int main()
    {
        int i = 0;
        int j = 0;
        
        if( ++i > 0 || ++j > 0 )
        {
            printf("%d ", i);
            printf("%d ", j);
        }
        
        return 0;
    }

    2.#include <stdio.h>

    int g = 0;

    int f()
    {
        return g++;
    }

    int main()
    {
        if( f() && f() )
        {
            printf("%d ", g);
        }
        
        printf("%d ", g);
        
        return 0;
    }
    3.#include <stdio.h>

    int main()
    {
        printf("%d ", !0);
        printf("%d ", !1);
        printf("%d ", !100);
        printf("%d ", !-1000);
        
        return 0;
    }


    4.#include <stdio.h>

    int main()
    {
        int a = 1;
        int b = 2;
        int c = 0;
        
        c = a < b ? a : b;
        
        (a < b ? a : b) = 3;
        
        printf("%d ", a);
        printf("%d ", b);
        printf("%d ", c);
        
        return 0;
    }

  • 相关阅读:
    Eighth scrum meeting
    Seventh scrum meeting
    Sixth scrum meeting
    Fifth scrum meeting
    Forth scrum meeting
    Third scrum meeting
    2019-07-25 L430 生物 GPS
    L429 Why Do Smart People Do Foolish Things?
    L427 长难句
    L426
  • 原文地址:https://www.cnblogs.com/wxb20/p/6145936.html
Copyright © 2011-2022 走看看