[ create a new paste ] login | about

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

C, pasted on Apr 21:
	B[0]=A[0];
	for(i=1;i<n;i++)
	{
		B[i]=B[i-1]+A[i];
	}
	for(i=0;i<n;i++)
	{
		C[i]=abs(sumday-2*B[i]);
	}
	submin=C[0];
	for(i=0;i<n;i++)
	{
		if(C[i]<submin)
		{
			submin=C[i];
			vt=i;
		}
	}
	printf("\n");
	for(i=0;i<n;i++)
	{
		printf("%3d",A[i]);
		if(i==vt) printf("\n");
	}


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Line 1: warning: data definition has no type or storage class
Line 1: error: 'A' undeclared here (not in a function)
Line 2: error: expected identifier or '(' before 'for'
Line 2: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
Line 2: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
Line 6: error: expected identifier or '(' before 'for'
Line 6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
Line 6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
Line 10: warning: data definition has no type or storage class
Line 10: error: 'C' undeclared here (not in a function)
Line 11: error: expected identifier or '(' before 'for'
Line 11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
Line 11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
Line 19: error: expected declaration specifiers or '...' before string constant
Line 19: warning: data definition has no type or storage class
Line 19: error: conflicting types for 'printf'
t.c:20: note: a parameter list with an ellipsis can't match an empty parameter name list declaration
Line 20: error: expected identifier or '(' before 'for'
Line 20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
Line 20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token


Create a new paste based on this one


Comments: