为什么一直输出1 电脑肚子里1太多了
#include <iostream> using namespace std; int main() { long long a[1000],n=0,i=0,k; cin>>k; while(a[i]!=1){ i++; a[i]=k; if(k%2==0) k=k/2; else k=3*k+1; n++; } for(int j=n-1;j>=1;j--) cout<<a[i]<<" "; return 0; }