961-20 Gruh talabasi Sattarova Sarvinozning Dasturlash2 fanidan 2-Lobaratoriya ishi
Ro‘yxatning nusxasini qurish, lekin teskari tartibda.
#include
#include
int main ()
{
std::list mylist;
for (int i=1; i<10; ++i) mylist.push_back(i);
mylist.reverse();
std::cout << "mylist contains:";
for (std::list::iterator it=mylist.begin(); it!=mylist.end(); ++it)
std::cout << ' ' << *it;
std::cout << '\n';
return 0;
}
Javobi:
mylist contains: 9 8 7 6 5 4 3 2 1
Do'stlaringiz bilan baham: |