⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 break.cpp

📁 C++的常用算法
💻 CPP
字号:
//这个程序在本书所带软盘中,文件名为BREAK.CPP
//这个程序演示中断语句break的应用。

#include <iostream.h>
#include <conio.h>

void main(void)
{
	char text[] = "This is a test string. It contains two setances.";
	int count;

	cout << "最初定义的文字为: " << text << endl;
	for (count = 0; text[count] != '\0'; count++)
	{
		if(text[count] == '.') {
			text[count+1] = '\0';
			break;
		}
	}
	cout << "修改后的文字为: " << text << endl;
}

/*这个程序运行后将输出如下输出结果:
最初定义的文字为: This is a test string. It contains two setances.
修改后的文字为: This is a test string.
*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -