Pushfrontitem coutlist c d 17 listintiterator

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: mecount++] = i; } for (i = 0; i<primecount; i++)// C { cout<<setw(5)<<A[i]; if ((i+1) % 10 == 0) // C 10 t d _ · ª : cout << endl; } cout<<endl; } 14 C++ ° è ·ª* °è · —— Ð B t A áµôåA+ áµôåA+ ·ª* ù A double ( ·ª* ÐBt ·ª* + “ ” è ( ° + 10-2 – ù A A 15 C++ _ l X ·ª* _lX · °˜ H · —— A+ Ç ì Ar + 10-3 + – Xl _· » » » ˜– Çì ª A A A A ª,E 8 splicing 8 9-7 10 ˜ – r r r r • ª _E ª _E ª _E )° · ª 6 Çì Ar • )° · ª 6 ÐB @ @ @ @ t « « « ÐBt· 16 //10_3.cpp #include <iostream> #include <list> using namespace std ; int main() { list<int> Link; // Ç ì A[ int i, key, item; for(i=0;i < 10;i++)// C 10 { cin>>item; Link.push_front(item); } cout<<"List: "; // C Àd 17 list<int>::iterator p=Link.begin(); while(p!=Link.end())// Ç ì A[ { cout <<*p << " "; p++; // C P E o ° · ª : } cout << endl; cout << " ð A ° : "; · cin >> key; Link.remove(key); cout << "List: "; // C p=Link.begin(); // C P E o ° · ª : while(p!=Link.end()) { cout <<*p << " "; p++; // C P E o ° · ª : } cout << endl; } 18 C++ ° x ·ª* °x · °Ø + ·ª Ðh – ˜ CÇ ì A + – + 10-4 Ø v ° · ª ( stack ( p ( 7Ø ° ·ª* °·ª* ÐB * deque Ðh –» ( – ( 10-5 Ø...
View Full Document

This note was uploaded on 10/26/2010 for the course CS 071122 taught by Professor Xuxiaohua during the Fall '07 term at Tsinghua University.

Ask a homework question - tutors are online