You are viewing a single comment's thread. Return to all comments →
int main(){ int n,i,j=0,c=0; int k,height_i; scanf("%d %d",&n,&k); int *height = malloc(sizeof(int) * n); for(height_i = 0; height_i < n; height_i++){ scanf("%d",&height[height_i]); } for(i=0;ij) j=height[i]; } if(j>k){
j=j-k; printf("%d",j);
} else printf("%d",c);
// your code goes here return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
The Hurdle Race
You are viewing a single comment's thread. Return to all comments →
include
include
include
include
include
include
include
int main(){ int n,i,j=0,c=0; int k,height_i; scanf("%d %d",&n,&k); int *height = malloc(sizeof(int) * n); for(height_i = 0; height_i < n; height_i++){ scanf("%d",&height[height_i]); } for(i=0;ij) j=height[i]; } if(j>k){
} else printf("%d",c);
}