cultered_man's blog

By cultered_man, history, 3 years ago, In English

Why I am I getting a infinite loop for the below code

#include<bits/stdc++.h>

using namespace std;

#define int long long
#define ar array
#define nl '\n'





void solve(){

	vector<int> a(1);
	
	for (int i=a.size()-2;i>=0;i--){
	    cout<<i<<nl;
	}

}

int32_t main(){
	

	int tt{1};

	for(int i=1;i<=tt;++i){
		solve();
		cout<<nl;
	}
}

It is working fine with other online compilers could someone please help me on this. Am I missing something?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it