//아로마 수 이번주 까지 꼭 끝내기
/*
#include <stdio.h>
#include <string.h>
int main()
{
int a=0,b,c,i,j,t=0, top=0;
int anw[11]={0}, ab[11]={0};
char in[42]={0};
gets(in);
for(i=0;i<strlen(in);i++)//데이터 넣기(성공)
//홀수:Xy 계산값
//짝수:아로마 수 크기
{
if(in[i]=='I')
{
a+=2;
anw[a-1] = (in[i-1]-'0')*1; //숫자로
anw[a] = 1;
printf("%d:%d\n", a-1, anw[a-1]);
printf("%d:%d\n", a, anw[a]);
}
else if(in[i]=='V')
{
a+=2;
anw[a-1] = (in[i-1]-'0')*5;
anw[a] = 2;
printf("%d:%d\n", a-1, anw[a-1]);
printf("%d:%d\n", a, anw[a]);
}
else if(in[i]=='X')
{
a+=2;
anw[a-1] = (in[i-1]-'0')*10;
anw[a] = 3;
printf("%d:%d\n", a-1, anw[a-1]);
printf("%d:%d\n", a, anw[a]);
}
else if(in[i]=='L')
{
a+=2;
anw[a-1] = (in[i-1]-'0')*50;
anw[a] = 4;
printf("%d:%d\n", a-1, anw[a-1]);
printf("%d:%d\n", a, anw[a]);
}
else if(in[i]=='C')
{
a+=2;
anw[a-1] = (in[i-1]-'0')*100;
anw[a] = 5;
printf("%d:%d\n", a-1, anw[a-1]);
printf("%d:%d\n", a, anw[a]);
}
else if(in[i]=='D')
{
a+=2;
anw[a-1] = (in[i-1]-'0')*500;
anw[a] = 6;
printf("%d:%d\n", a-1, anw[a-1]);
printf("%d:%d\n", a, anw[a]);
}
else if(in[i]=='M')
{
a+=2;
anw[a-1] = (in[i-1]-'0')*1000;
anw[a] = 7;
printf("%d:%d\n", a-1, anw[a-1]);
printf("%d:%d\n", a, anw[a]);
}
}
for(i=0;i<a;i+=2)//연산 //- + 순서 에러
{
top++;
t+=2;
if(anw[i] >= anw[i+2])//+ 완료
{
printf("[+][%d>=%d]%d:%d+%d", anw[i], anw[i+2], i+1, anw[i-1], anw[i+1]);
anw[i+1] = anw[i-1] + anw[i+1];//anw:계산할 순서(아로마 수의 크기)
printf("=%d\n", anw[i+1]);
}
if(anw[i]!=0)
{
if(anw[i] < anw[i+2])//- ERROR
{
printf("[-][%d<%d]%d:%d-%d", anw[i], anw[i+2],i+1, anw[i-1], anw[i+1]);
anw[i+1] = anw[i-1] - anw[i+1];
ab[top] = anw[i+1];
printf("=%d\n", anw[i+1]);
}
}
}
}
*/ HOMEWORK



