You are viewing a single comment's thread. Return to all comments →
#include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <assert.h> #include <limits.h> #include <stdbool.h> int main(){ int n; scanf("%d",&n); int *file = malloc(sizeof(int) * n); for(int file_i = 0; file_i < n; file_i++){ scanf("%d",&file[file_i]); } int c = 0; for(int i = 0; i < n; i++){ i += file[i]; c++; } printf("%d",c); return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Recover the Arrays
You are viewing a single comment's thread. Return to all comments →