随笔分类 - C++
摘要:if语句 if语句的3种形式如下: 第1种形式: if(表达式)语句 其语义是:如果表达式的值为真,则执行其后的语句,否则不执行该语句。 第2种形式: if(表达式) 语句1 else 语句2 其语义是:如果表达式的值为真,则执行语句1,否则执行语句2...
阅读全文
摘要:算数运算符算数运算符功能列表算数运算符说明算术运算符说明+加法运算符/除法运算符-减法运算符%求模运算符*乘法运算符#include "stdafx.h"#include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ int...
阅读全文
摘要:cout函数,该函数用于输出数据 cout函数用于向屏幕输出数据,语法如下: std::cout头文件,否则程序无法编译。#include "stdafx.h"#include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ ...
阅读全文