We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
i am getting a vague error //it says solution.cc:16:32: warning: iteration 4u invokes undefined behavior [-Waggressive-loop-optimizations]
for (int j=i+1;j
^
Try this int main(){ int arr[100]; for(int j=1;j<6;j++) {cin>>arr[j];} int count=0; for(int i=1;i<6;i++)
{if(arr[i]==i) { count+=100 ;
}
my code is working just fine..yet showing wrong answer for a few test cases :/ https://www.hackerrank.com/contests/hourrank-3/challenges/contest-performance/submissions/code/4755580
i am getting a vague error //it says solution.cc:16:32: warning: iteration 4u invokes undefined behavior [-Waggressive-loop-optimizations] for (int j=i+1;j ^
something is wrong with indentation...