You are viewing a single comment's thread. Return to all comments →
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 ;
} else if(arr[i]!=i&&arr[i]<=10+i) { count+=100-(arr[i]-i)*10; } } cout<<count; return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Contest Performance
You are viewing a single comment's thread. Return to all comments →
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 ;
}