ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1001. Reverse Root

Crash (access violation). С++
Posted by JIesnik 22 May 2011 14:34
#include <iostream>
#include <stdio.h>
#include <cmath>

using namespace std;

int main() {
    int c;
    double a[1024];
    for(c=0;cin;c++) {
        cin >> a[c];
    }
    for(int i = c-2;i >= 0;i--) {
        printf("%.4f",sqrt(a[i]));
        printf("\n");
    }
    return 0;
}

I tested it on gcc - all work. Please, help. What's wrong?

Edited by author 22.05.2011 14:48

Edited by author 22.05.2011 14:49
Re: Crash (access violation). С++
Posted by AterLux 22 May 2011 17:49
Once more and once more: If you have access violation, look at your array-sizes first.

2 Admins: Maybe that need be placed in FAQ ?