[ create a new paste ] login | about

Link: http://codepad.org/GPLbdyXQ    [ raw code | output | fork ]

C, pasted on Jul 17:
#include <stdio.h>
#include <stdlib.h>
#include "iostream"
A[2, -4, 6,-3,9];
N=5;
a=solucion(A,N);
cout<<a;
int solucion(int A[],int N){
int p=0;
int suma=A[p];
min=100;
for(i=1;i<=N;i++){
for(j=p+1;j<=N;j++){
suma=suma+A[i];
sumabs=abs(suma);
    if(sumabs<min){min=sumabs;}


}
p=p+1;
suma=A[p];

}
return min;

}


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Line 19: error: iostream: No such file or directory
Line 4: error: expected ']' before ',' token
Line 5: warning: data definition has no type or storage class
Line 6: warning: data definition has no type or storage class
Line 6: error: 'A' undeclared here (not in a function)
Line 6: error: initializer element is not constant
Line 7: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<<' token
In function 'solucion':
Line 11: error: 'min' undeclared (first use in this function)
Line 11: error: (Each undeclared identifier is reported only once
Line 11: error: for each function it appears in.)
Line 12: error: 'i' undeclared (first use in this function)
Line 13: error: 'j' undeclared (first use in this function)
Line 15: error: 'sumabs' undeclared (first use in this function)


Create a new paste based on this one


Comments: