小白刚学编程,请教各位大佬我这段代码问题在哪呀
#include<iostream>
#include<vector>
using namespace std;
int main(){
int i,j,t,x,y;
vector<int>a;
cout<<"请输入要排序的个数:"<<endl;
cin>>i;
a.resize(i);
cout<<"请输入要排序的号:"<<endl;
for(x=0;x<i;x++){
cin>>a[x];
}
for(y = 0; y < i-1 ; y++)
for(j = 0; j < i-1 ; j++){
if (a[j]>a[j+1])
t = a[j+1];a[j+1] = a[j]; a[j] = t;
}
for(auto it = a.begin();it != a.end();it++)
cout<<*it<<" ";
return 0;
}