WA了8个……请求指点
查看原帖
WA了8个……请求指点
1066515
Hyaline0824楼主2023/8/20 09:47
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string.h>
using namespace std;
int main()
{
	int i,a[i],s=0,c=0,x;
	a[0]=0;
	for (i=1;i<=12;i++)
	{
		cin >> a[i];
	}
	for (i=1;i<=12;i++)
	{
		s=s-a[i]+300;
		if (s<0)
		{
			cout << "-" << i;
			return 0;
		}
		x=s%100;
		c=c+s-x;
	}
	cout << 1.2*c+x;
    return 0;
}
2023/8/20 09:47
加载中...