20分求大佬,C++
查看原帖
20分求大佬,C++
1450083
yufan_Arvin楼主2024/10/7 11:28

懵了``` #include using namespace std; int a[13]; int money=0; float aws=10; int morey=0; //moremoney=morey^-^ int main(){ a[0]=-1; for(int i=1;i<=12;i++){ cin>>a[i]; } for(int i=1;i<=12;i++){ money+=300; money-=a[i]; if(money<0){ aws=i*-1; break; } if(money>=100){ cout<<1; morey+=(money-money%100)/100; money-=(money-money%100)/100; } } if(aws==10){ morey*=1.2; cout<<morey; } else{ cout<<aws; } return 0; }

2024/10/7 11:28
加载中...