Language: C

#include <stdio.h>

/* ????????? */
#define U1 unsigned char
#define S4 int
#define U4 unsigned int

/* ??????????????? */
#define MAX_ITEMS (50)
#define END_MARK	(0)
#define MAX_GRAM	(5000)
#define MIN_GRAM	(500)
#define UNIT		(100)	/* ?????????DP??????????????????????????????????????? */
#define DP_TABLE_WEIGHT_SIZE	((MAX_GRAM) / (UNIT))

/* ?????°???????????¨????????????????????? */
#define TABLE_SIZE	(6)
const s4_g_buckwheat100Gram[TABLE_SIZE] = { 2, 3, 5, 10, 12, 15 };
const s4_g_buckwheatPrice[TABLE_SIZE] = { 380, 550, 850, 1520, 1870, 2244 };




static S4 s4_s_calcPrice(S4 s4_a_gram);

S4 main()
{
	U1 u1_t_delimiter;					/* ??????????????? */
	S4 s4_t_cnt;						/* ????????????????????? */
	S4 s4_t_input;						/* ??\????????????????????? */
	S4 s4_t_result;

	for (s4_t_cnt = (S4)0; s4_t_cnt < (S4)MAX_ITEMS; s4_t_cnt++)
	{
		scanf_s("%d%c", &s4_t_input, &u1_t_delimiter);
		if (s4_t_input == (S4)END_MARK)
		{
			break;
		}
		s4_t_result = s4_s_calcPrice(s4_t_input);

		printf("%d\n", s4_t_result);
	}
	return ((S4)(0));
}

/* ?????°????????°?????°????????° */
/* ???????????????????????? */
static S4 s4_s_calcPrice(S4 s4_a_gram)
{
	S4 s4_t_dp[TABLE_SIZE][DP_TABLE_WEIGHT_SIZE] = {0};		/* dp??????????¨???????????????°????¨????(ABC,??????????????§6?¨????)??¨?????°?????????/100???????????? */
	S4 s4_t_itemIndex;
	S4 s4_t_weightIndex;
	S4 s4_t_100gram;	/* ?????°????????????100??°?????????????????????????????? */
	S4 s4_t_tmp;		/* DP??´??°??¨ */
	S4 s4_t_result;

	/* ???????????¨ */
	S4 s4_t_i;
	S4 s4_t_j;

	s4_t_100gram = s4_a_gram / (S4)UNIT;

	/* ???????????????????????§????????? */
	for (s4_t_i = (S4)0; s4_t_i < (S4)TABLE_SIZE; s4_t_i++)
	{
		for (s4_t_j = (S4)0; s4_t_j < (S4)DP_TABLE_WEIGHT_SIZE; s4_t_j++)
		{
			s4_t_dp[s4_t_i][s4_t_j] = (S4)99999999;
		}
	}
	s4_t_dp[0][2] = 380;
	s4_t_dp[1][3] = 550;

	for (s4_t_itemIndex = (S4)0; s4_t_itemIndex < (S4)TABLE_SIZE - 1; s4_t_itemIndex++)
	{
		/* 100g????????§DP????????????????????´??° */
		for (s4_t_weightIndex = (S4)0; s4_t_weightIndex <= s4_t_100gram; s4_t_weightIndex++)
		{
			/* DP?¨????????????¢?????????????????????????????????????????§???????????´??? */
			if (s4_g_buckwheat100Gram[s4_t_itemIndex] > s4_t_weightIndex)
			{
				s4_t_dp[s4_t_itemIndex + 1][s4_t_weightIndex] = s4_t_dp[s4_t_itemIndex][s4_t_weightIndex];
			}
			else
			{
				/* DP?¨????????????¢??????????????????????????´????????????????????????????¨????????????¢???????????????????????????????????????????¨????????????¢?????????????????? */
				s4_t_tmp = s4_t_dp[s4_t_itemIndex][s4_t_weightIndex - s4_g_buckwheat100Gram[s4_t_itemIndex]] + s4_g_buckwheatPrice[s4_t_itemIndex];
				/* DP?¨????????????¢??????????????????????????´?????¨?????????????????£?????´?????§?????????????????¨ */
				if (s4_t_tmp < s4_t_dp[s4_t_itemIndex][s4_t_weightIndex])
				{
					s4_t_dp[s4_t_itemIndex + 1][s4_t_weightIndex] = s4_t_tmp;
				}
				else
				{
					s4_t_dp[s4_t_itemIndex + 1][s4_t_weightIndex] = s4_t_dp[s4_t_itemIndex][s4_t_weightIndex];
				}
			}
		}
	}
	s4_t_result = s4_t_dp[TABLE_SIZE - 1][s4_t_100gram];
	return (s4_t_result);
}

Compiler output:
main.c:18:7: error: type defaults to 'int' in declaration of 's4_g_buckwheat100Gram' [-Wimplicit-int]
   18 | const s4_g_buckwheat100Gram[TABLE_SIZE] = { 2, 3, 5, 10, 12, 15 };
      |       ^~~~~~~~~~~~~~~~~~~~~
main.c:19:7: error: type defaults to 'int' in declaration of 's4_g_buckwheatPrice' [-Wimplicit-int]
   19 | const s4_g_buckwheatPrice[TABLE_SIZE] = { 380, 550, 850, 1520, 1870, 2244 };
      |       ^~~~~~~~~~~~~~~~~~~
main.c: In function 'main':
main.c:35:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   35 |                 scanf_s("%d%c", &s4_t_input, &u1_t_delimiter);
      |                 ^~~~~~~
      |                 scanf