Chce napisać program który będzie wczytywał liczby aż nie dostanie 0 a potem je posortuje. Nie mogę znaleźć tu błędu to jest mój kod:
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
vector <int> tab;
int a;
int main()
{
do
{
cin >> a;
tab.push_back(a);
}while(a != 0);
sort(tab.begin(),tab.end());
for(int i = 0; i < tab.end(); i++)
cout << tab[i];
}