redefinition in c

  • 0

    int missNumber(int a[],int n) {
    int x,total;
    total =(n+1)*(n+2)/2;
    for (x=0;x<n;x++)
    total -=a[x];
    return total;
    int main(void)
    int a[]={1,2,3,5,6,7,8};
    int miss=missNumber(a,7);


    Line 15: redefinition of 'main'
    I have not used the main function repeatedly, and I get this error.

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.