Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22024

GCC 6.3 throws a runtime error whenever the input is more than one number. What could be the possible reason?

$
0
0

This a preliminary attempt to solve the Bytelandian Gold Coin problem in CodeChef.

int main(void) {

    long long int n = -1;
    scanf("%lld", &n);
    while(n != -1){
        int b[n];
        for(int i=0; i<n; i++)  b[i] = -1;
        for(int i=0; i<n; i++)  printf("%d ",b[i]);
        printf("\n");
        n = -1;
        scanf("%d", &n);
    }
    return 0;
}

Viewing all articles
Browse latest Browse all 22024

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>