#include?<stdio.h>
int?main()
{
float?OriginalPrice,?PresentPrice;
int?UseTime;
while?(1)
{
printf("Please?input?the?use?time?and?original?price:(sample:8?10000)\n");
scanf_s("%d?%f",?&UseTime,?&OriginalPrice);
if?(UseTime?<?0)?break; //輸入負數,結束程序
if?(UseTime?<?3)?PresentPrice?=?OriginalPrice;
else?if?(UseTime?>=?3?&&?UseTime?<?6)?PresentPrice?=?OriginalPrice?*?0.02;
else?if?(UseTime?>=?6?&&?UseTime?<?12)?PresentPrice?=?OriginalPrice?*?0.05;
else?if?(UseTime?>=?12?&&?UseTime?<?21)?PresentPrice?=?OriginalPrice?*?0.08;
else?PresentPrice?=?OriginalPrice?*?0.1;
printf("The?Depreciation?price?is?:?%.2f\n\n",?PresentPrice); //保留兩位小數點
}
return?0;
}