[ create a new paste ] login | about

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

C, pasted on May 17:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "stdio.h"

int max(int a, int b)
{
    if(a>b) return a;
    return b;
}

int main()
{
 int hp=423540,def=237997;
 int i,j,k;
 int a1=291000,a2=349200,a3=320100;
 int d1=a1-def,d2=a2-def,d3=a3-def;
 for (i=0;i<=10;i++)
  for (j=0;j<=10;j++)
   for (k=0;k<=10;k++)
    if ((i*d1+j*d2+k*d3<hp) &&(i*d1+j*d2+k*d3+d1>=hp)) 
    printf("%d %d %d %d %.2f\n",i,j,k,hp-i*d1+j*d2+k*d3,a1-(hp-j*d2k*d3)/(i+1));
return 0;
}


Output:
1
2
3
4
In function 'main':
Line 19: error: 'd2k' undeclared (first use in this function)
Line 19: error: (Each undeclared identifier is reported only once
Line 19: error: for each function it appears in.)


Create a new paste based on this one


Comments: