为什么是0分?
查看原帖
为什么是0分?
687911
chenyihao2011楼主2023/10/16 20:19
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m,s[10005],cnt,res;
	cin>>n>>m;
	cnt=m;
	for(int i=1;i<=n;i++) cin>>s[i];
	for(int i=1;i<=n;i++){
		if(cnt>=s[i]) cnt-=s[i];
        }
	res=floor(0.12*(m-cnt));
	cout<<res<<endl;
	return 0;
} 

各位大佬哪里出问题了?

2023/10/16 20:19
加载中...