首页 > 学院 > 开发设计 > 正文

fig3.3

2019-11-06 08:16:49
字体:
来源:转载
供稿:网友
#include<iostream>#include<string>using namespace std;class GradeBook{public:	void displayMessage(string courseName) const	{		cout << "Welcome to the book for/n" << courseName << "!"			<< endl;	}};int main(){	string nameOfcourse;	GradeBook myGradeBook;	cout << "Please enter the course name:" << endl;	getline(cin, nameOfcourse);	cout << endl;	myGradeBook.displayMessage(nameOfcourse);	system("pause");	return 0;}
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表