Closed. This question needs details or clarity。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗?添加详细信息并通过editing this post阐明问题。
                        
                        5年前关闭。
                                                                                            
                
        
为什么在这种情况下不调用printf()?在这种情况下可以使用&&还是什么?

{
   int zz1,zz2;
   zz1 = 8;
   zz2= zz1 / 2;
   if ( (zz1==! 0 ) && (zz2 ==! 1 ) ){
      printf("!!!!!!!!!!");
   }
}

最佳答案

我想您会写(zz1 != 0 ) && (zz2 != 1 )

实际上(zz1 == !0 ) && (zz2 == !1 )是有效的语法,但是在这种情况下,由于您正在编写,因此它会产生不需要的结果:


zz1 equals to (not)0 AND zz2 equals to (not)1
那是zz1 equals to 1 AND zz2 equals to 0
这是错误的,因此不会调用printf

10-07 20:36