随笔分类 -  C++

上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要:1:代码如下: // 4.2.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using std::cout; using std::endl; bool Less(int a,int b = 1) //b具有默认值1 阅读全文
posted @ 2017-09-14 09:38 一串字符串
摘要:1:代码如下: // 4.1.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void ShowMessage(); //函数声明语句 void ShowAge(); //函数声 阅读全文
posted @ 2017-09-14 09:31 一串字符串
摘要:1:代码如下: // 3.25.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; int main(int argc, _TCHAR* argv[]) { //若直接使用for循环 阅读全文
posted @ 2017-09-14 09:11 一串字符串
摘要:1:运行代码: // 3.24.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; int main(int argc, _TCHAR* argv[]) { do{ int num, 阅读全文
posted @ 2017-09-14 09:01 一串字符串
摘要:1:代码如下: // 3.23.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iomanip> #include <iostream> using namespace std; void main(void) { int i,j; i=1 阅读全文
posted @ 2017-09-14 08:54 一串字符串
摘要:1:代码如下: // 3.22.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { int i, j, k; for (i = 1; i <= 5; i+ 阅读全文
posted @ 2017-09-14 08:40 一串字符串
摘要:1:代码如下: // 3.21.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { int ivar = 0 ; //定义一个整型变量,初始化为0 int 阅读全文
posted @ 2017-09-14 08:25 一串字符串
摘要:1:continue不是立即跳出循环体,而是跳过本次循环结束前的语句,回到循环的条件测试部分。代码如下: // 3.20.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void 阅读全文
posted @ 2017-09-13 16:27 一串字符串
摘要:1:代码如下: // 3.19.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { int i,n,sum; sum=0; cout<< "请输入10个整 阅读全文
posted @ 2017-09-13 16:21 一串字符串
摘要:1:代码如下: // 3.18.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { int sum=0; int i; for(i=1;i<=10;i++ 阅读全文
posted @ 2017-09-13 16:14 一串字符串
摘要:1:代码如下: // 3.17.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { int i=0,j=0; cout << "执行while前j=" < 阅读全文
posted @ 2017-09-13 16:08 一串字符串
摘要:1:代码如下: // 3.16.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { int i=0,j=0; cout << "before do_whi 阅读全文
posted @ 2017-09-13 16:04 一串字符串
摘要:1:代码如下: // 3.15.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { int sum=0,i=1; do { sum=sum+i; i++; 阅读全文
posted @ 2017-09-13 15:59 一串字符串
摘要:1:代码如下: // 3.14.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { int sum=0,i=1; while(i<=10) { sum=s 阅读全文
posted @ 2017-09-13 15:53 一串字符串
摘要:1:不加break,会依次运行下面的语句,代码如下: // 3.13.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { cout<<"输入一个1-7范围 阅读全文
posted @ 2017-09-13 15:46 一串字符串
摘要:1:代码如下: // 3.12.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { cout<<"输入一个A-D范围内的大写字母作为成绩评价"<<endl 阅读全文
posted @ 2017-09-13 15:42 一串字符串
摘要:1:代码如下: // 3.11.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { cout<<"输入一个A-D范围内的大写字母作为成绩评价"<<endl 阅读全文
posted @ 2017-09-13 15:38 一串字符串
摘要:1:代码如下: // 3.10.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> #include <iomanip> using namespace std; void main() { cout<<"输入一个A-D范围 阅读全文
posted @ 2017-09-13 15:02 一串字符串
摘要:1:代码如下: // 3.9.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include<iostream> using namespace std; void main() { int iInput; cout << "输入一个整数" << endl; 阅读全文
posted @ 2017-09-13 14:46 一串字符串
摘要:1:代码如下: // 3.8.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include<iostream> using namespace std; void main() { int iInput; cout << "输入一个整数" << endl; 阅读全文
posted @ 2017-09-11 20:23 一串字符串

上一页 1 ··· 3 4 5 6 7 8 9 下一页