-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path7Prova.cpp
More file actions
35 lines (30 loc) · 844 Bytes
/
7Prova.cpp
File metadata and controls
35 lines (30 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <iostream>
#include <conio.h> // comando in put e out put
#include <iomanip> // usando os manipuladores
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <list>
using namespace std;
int main (){
int numero = 1;
list <int> minhaLista;
list<int>::iterator n;
cout <<"Informe 0 para parar\n";
while (numero != 0) {
cout <<"Informe um numero: ";
cin >> numero;
minhaLista.push_back(numero);
}
cout <<"\n------------------ Digitados ------------------------\n";
for (n = minhaLista.begin(); n != minhaLista.end(); n++) {
cout<<*n <<" - ";
}
minhaLista.pop_back();
minhaLista.sort();
cout <<"\n------------------ Crescente ------------------------\n";
for (n = minhaLista.begin(); n != minhaLista.end(); n++) {
cout<<*n <<" - ";
}
}