摘要:
1:continue不是立即跳出循环体,而是跳过本次循环结束前的语句,回到循环的条件测试部分。代码如下: // 3.20.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void 阅读全文
摘要:
1:代码如下: // 3.19.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { int i,n,sum; sum=0; cout<< "请输入10个整 阅读全文
摘要:
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++ 阅读全文
摘要:
1:代码如下: // 3.17.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { int i=0,j=0; cout << "执行while前j=" < 阅读全文
摘要:
1:代码如下: // 3.16.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { int i=0,j=0; cout << "before do_whi 阅读全文
摘要:
1:代码如下: // 3.15.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { int sum=0,i=1; do { sum=sum+i; i++; 阅读全文
摘要:
1:代码如下: // 3.14.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { int sum=0,i=1; while(i<=10) { sum=s 阅读全文
摘要:
1:不加break,会依次运行下面的语句,代码如下: // 3.13.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { cout<<"输入一个1-7范围 阅读全文
摘要:
1:代码如下: // 3.12.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { cout<<"输入一个A-D范围内的大写字母作为成绩评价"<<endl 阅读全文
摘要:
1:代码如下: // 3.11.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { cout<<"输入一个A-D范围内的大写字母作为成绩评价"<<endl 阅读全文
摘要:
1:代码如下: // 3.10.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> #include <iomanip> using namespace std; void main() { cout<<"输入一个A-D范围 阅读全文
摘要:
1:代码如下: // 3.9.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include<iostream> using namespace std; void main() { int iInput; cout << "输入一个整数" << endl; 阅读全文