码迷,mamicode.com
首页 > 编程语言 > 详细

C/C++逻辑运算的验证原则

时间:2014-07-11 00:25:35      阅读:304      评论:0      收藏:0      [点我收藏+]

标签:cc++逻辑运算的验证原则

基本原则为:从左向右,当前逻辑表达式不满足立刻停止后续验证

code

// test.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include <stdlib.h>

int main(void)
{
	int m=0;
	int n=0;

	if(m==1 && ++n==1)
	{
		printf("It is OK!\n");
	}
	printf("The first n=%d\n",n);

	if(++n==1 && m==1)
	{
		printf("It is in!\n");
	}
	printf("The second n=%d\n",n);

	system("pause");
	return 0;
}
bubuko.com,布布扣

C/C++逻辑运算的验证原则,布布扣,bubuko.com

C/C++逻辑运算的验证原则

标签:cc++逻辑运算的验证原则

原文地址:http://blog.csdn.net/cjc211322/article/details/37598685

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!