本文整理汇总了C++中DoubleLinkedList::at方法的典型用法代码示例。如果您正苦于以下问题:C++ DoubleLinkedList::at方法的具体用法?C++ DoubleLinkedList::at怎么用?C++ DoubleLinkedList::at使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DoubleLinkedList
的用法示例。
在下文中一共展示了DoubleLinkedList::at方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
//DoubleLinkedList<double> DLL;
/*cout << "This is my Double Linked List. Please kill me.\n\n";
while (true)
{
int choice = menu();
if (choice == 0)
{
for (size_t i = 0; i < DLL.size(); i++)//Print DLL
{
cout << DLL.at(i) << " ";
}
cout << endl;
}
else if (choice == 1)
{
cout << "Addwhat?: ";
int toAdd;
cin >> toAdd;
DLL.addFront(toAdd);
}
else if (choice == 2)
{
cout << "Addwhat?: ";
int toAdd;
cin >> toAdd;
DLL.addRear(toAdd);
}
else if (choice == 3)
{
cout << "What: ";
int what, index;
cin >> what;
cout << "Where: ";
cin >>index;
DLL.addAt(what,index);
}
else if (choice == 4)
{
}
else if (choice == 5)
{
}
else if (choice == 6)
{
}
else if (choice == 7)
{
}
else if (choice == 8)
{
}
else if (choice == 9)
{
}
else if (choice == 10)
{
}
else if (choice == 11)
{
}
else if (choice == 12)
{
}
else if (choice == 13)
{
}
else if (choice == 14)
{
}*/
//for (size_t i = 0; i < 5; i++)
//{
// DLL.addFront(rand()%3);
// DLL.addRear(rand()%3);
// if (!DLL.addAt(rand()%3, (rand() % DLL.size()*2)-DLL.size()))
// cout << "\nDidn't add something\n\n";
//}
//for (size_t i = 0; i < DLL.size(); i++)//Print DLL
//{
// cout << DLL.at(i) << " ";
//}
//cout << endl << "Size: " << DLL.size() << endl;
//cout << DLL.at(5) <<endl;
//if (DLL.contains(99))
// cout << "Got Item!\n";
//else
//.........这里部分代码省略.........