摘要: 1:continue不是立即跳出循环体,而是跳过本次循环结束前的语句,回到循环的条件测试部分。代码如下: // 3.20.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void 阅读全文
posted @ 2017-09-13 16:27 一串字符串 阅读(792) 评论(0) 推荐(0) 编辑
摘要: 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 一串字符串 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 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 一串字符串 阅读(2141) 评论(0) 推荐(0) 编辑
摘要: 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 一串字符串 阅读(387) 评论(0) 推荐(0) 编辑
摘要: 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 一串字符串 阅读(430) 评论(0) 推荐(0) 编辑
摘要: 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 一串字符串 阅读(816) 评论(0) 推荐(0) 编辑
摘要: 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 一串字符串 阅读(2896) 评论(0) 推荐(0) 编辑
摘要: 1:不加break,会依次运行下面的语句,代码如下: // 3.13.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { cout<<"输入一个1-7范围 阅读全文
posted @ 2017-09-13 15:46 一串字符串 阅读(845) 评论(0) 推荐(0) 编辑
摘要: 1:代码如下: // 3.12.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { cout<<"输入一个A-D范围内的大写字母作为成绩评价"<<endl 阅读全文
posted @ 2017-09-13 15:42 一串字符串 阅读(448) 评论(0) 推荐(0) 编辑
摘要: 1:代码如下: // 3.11.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { cout<<"输入一个A-D范围内的大写字母作为成绩评价"<<endl 阅读全文
posted @ 2017-09-13 15:38 一串字符串 阅读(591) 评论(0) 推荐(0) 编辑
摘要: 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 一串字符串 阅读(403) 评论(0) 推荐(0) 编辑
摘要: 1:代码如下: // 3.9.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include<iostream> using namespace std; void main() { int iInput; cout << "输入一个整数" << endl; 阅读全文
posted @ 2017-09-13 14:46 一串字符串 阅读(317) 评论(0) 推荐(0) 编辑