本文整理汇总了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();
}
示例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) {
示例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;
}