s1.cpp

来自「这是清华大学出版社的《数据结构》的电子文档讲义」· C++ 代码 · 共 19 行

CPP
19
字号
// s1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "array.h"

int main(int argc, char* argv[]){
	string x1 = "student";   	cout<<"x1="<<x1;  //x1=student
	string x2 = "teacher";		cout<<"x2="<<x2;  //x2=teacher
	string x3(x1),x4,x5,x6;	    cout<<"x3="<<x3;  //x3=student
	x4 = x2;               	    cout<<"x4="<<x4;  //x4=teacher
	x5 = x1 += x2;           	cout<<"x5="<<x5;  //x5=studentteacher
	x6 = x5(4,5);          	    cout<<"x6="<<x6;  //x6=entte
	string x7 = x5(0,2),x8;	x7 += x5(1,3) += x5(2,4);
	cout<<"x7="<<x7;                              //x7=sttududen
	for(int i=0;i<4;i++) x8 += x5(4*i,2);
	cout<<"x8="<<x8;return 0;                     //x8=steneaer
}

⌨️ 快捷键说明

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