mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1189.c
This commit is contained in:
parent
2e3c63a851
commit
8784cc2469
32
QUSTOJ/1189.c
Normal file
32
QUSTOJ/1189.c
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include <stdio.h>
|
||||
int main()
|
||||
{
|
||||
int plan[12];
|
||||
int month,saved,now;
|
||||
for(month=0,saved=0,now=0;month<12;month++)
|
||||
{
|
||||
scanf("%d",&plan[month]);
|
||||
}
|
||||
for(month=0;month<12;month++)
|
||||
{
|
||||
now+=300;
|
||||
if(now-plan[month]>=100)
|
||||
{
|
||||
saved=saved+((now-plan[month])/100)*100;
|
||||
now=now-((now-plan[month])/100)*100;
|
||||
now=now-plan[month];
|
||||
continue;
|
||||
}
|
||||
else if(now-plan[month]<0)
|
||||
{
|
||||
printf("%c%d\n",'-',month+1);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
now=now-plan[month];
|
||||
}
|
||||
}
|
||||
printf("%d\n",now+(saved*6)/5);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user