[ create a new paste ] login | about

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

C, pasted on Jun 30:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void filling(int amount, int cur, int nv)
{
    int temp=0, filled=0;
    if(cur<nv){
        if(amount==0) filled=1;
        else if(amount>0){
            filling(amount, cur+1, nv);
            numbers[cur]++;
            filling(amount-liters[cur], cur, nv);
            numbers[cur]--;
        }
    }
    if(filled){
        for(int i=0;i<nv;i++) temp += numbers[i];
        if(temp<min){
            min = temp;
            for(int i=0;i<nv;i++) min_numbers[i]=numbers[i];
        }
        filled = 0;
    }
}


Output:
1
2
3
4
5
6
7
8
9
In function 'filling':
Line 8: error: 'numbers' undeclared (first use in this function)
Line 8: error: (Each undeclared identifier is reported only once
Line 8: error: for each function it appears in.)
Line 9: error: 'liters' undeclared (first use in this function)
Line 14: error: 'for' loop initial declaration used outside C99 mode
Line 15: error: 'min' undeclared (first use in this function)
Line 17: error: 'for' loop initial declaration used outside C99 mode
Line 17: error: 'min_numbers' undeclared (first use in this function)


Create a new paste based on this one


Comments: