当前位置: 首页>>代码示例>>C++>>正文


C++ LList::print方法代码示例

本文整理汇总了C++中LList::print方法的典型用法代码示例。如果您正苦于以下问题:C++ LList::print方法的具体用法?C++ LList::print怎么用?C++ LList::print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LList的用法示例。


在下文中一共展示了LList::print方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: problem_2

void problem_2(graph<Person> g, Person person) {
  if (person.likes.len() < 2) {
    cout << "You succcccc " << endl;
    return;
  }


  LList<Person> friendsOfFriends = findFriendsOfFriends(g, person);
  LList<Person> result = filterByCommonInterests(friendsOfFriends, person, 2);

  cout << "Friends of Friends:" << endl;
  friendsOfFriends.print();
  cout << endl;
  cout << "Friends of Friends with 2 interests:" << endl;
  result.print();
}
开发者ID:stefolog,项目名称:fmi-sdp2015,代码行数:16,代码来源:graphproblems.cpp

示例2: serve_level

int serve_level(string riddle, string answer, string allowable_chars) {
	bool correct_answer = false;
	int player_input_1;
	char player_input_2;
	LList<char> l;

	cout << riddle << endl;
	while(!correct_answer) {
		player_input_1 = 0;
		cout << "Available letters: " << allowable_chars << endl;
		cout << "Choose something to do to the list: " << endl;
		cout << "[1] to Append a letter to the back of the list. " << endl;
		cout << "[2] to Push a letter to the front of the list. " << endl;
		cout << "[3] to Delete a letter from the list. " << endl;
		cout << "The list will be printed out each time you modify it. " <<endl;
		cin >> player_input_1;
		if(player_input_1 == 1) {
			cout << "Select a letter to append. " << endl;
			cin >> player_input_2;
			if(allowable_chars.find(player_input_2) != string::npos) {
				l.append(player_input_2);
				cout << player_input_2 << " appended to the list! " << endl;
				l.print();
			} else {
				cout << "Please use a valid letter! ";
			}
		} else if(player_input_1 == 2) {
开发者ID:lescott,项目名称:Data_Structure_Games,代码行数:27,代码来源:linked_list_game.cpp

示例3: main

int main()
{
        LList c;
        int k;
        cin>>k;
        for (int i=1; i<=k; ++i) {
                for (int j=0; j<=i; ++j)
                        c.insert(fraction(j,i));
        }
        c.print();
        return 0;
}
开发者ID:weehowe-z,项目名称:Backup,代码行数:12,代码来源:Exam+frac.cpp


注:本文中的LList::print方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。