none
逻辑问题:a<=47 && a>=46,a能是多少?条件整数 RRS feed

答案

  • 你好 czhch,

    欢迎在MSDN论坛发帖。

    >>a<=47 && a>=46,a能是多少?

    这个是指满足46<=a<=47的整数,分别是46、47。

    >>和a==47||a==46相当吗?

    这里满足条件的a的值为46或者47时,如果放在if等的条件中,与上面46<=a<=47相当。

    >>和a<48 && a>45相当吗?

    这里满足条件45<a<48的整数为46、47,46<=a<=47相当。

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.





    2018年8月20日 8:14
    版主

全部回复

  • 你好 czhch,

    欢迎在MSDN论坛发帖。

    >>a<=47 && a>=46,a能是多少?

    这个是指满足46<=a<=47的整数,分别是46、47。

    >>和a==47||a==46相当吗?

    这里满足条件的a的值为46或者47时,如果放在if等的条件中,与上面46<=a<=47相当。

    >>和a<48 && a>45相当吗?

    这里满足条件45<a<48的整数为46、47,46<=a<=47相当。

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.





    2018年8月20日 8:14
    版主
  • 可以试着写个循环,给a赋值 45-48,然后 打印一下这几个判断的结果和对应的a值,最快的得出结论;


    family as water

    2018年8月21日 6:09