You are viewing a single comment's thread. Return to all comments →
Why I am getting segmentation fault in test case 4 and 5 ,help me out. this is my code
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */ int n,k, c[10000],Bc,sum=0,res,rc; scanf("%d",&n); scanf("%d",&k); for(int i=0;i<n;i++){ scanf("%d",&c[i]); sum=sum+c[i]; } scanf("%d",&Bc); if((sum-c[k])/2==Bc){ printf("Bon Appetit"); } else { res=Bc-((sum-c[k])/2); printf("%d",res); }return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Bill Division
You are viewing a single comment's thread. Return to all comments →
Why I am getting segmentation fault in test case 4 and 5 ,help me out. this is my code
int main() {
}