提交时间:2023-10-08 13:25:11

运行 ID: 105806

#include<bits/stdc++.h> using namespace std; int main() { int jl[9],y[9],k=-1,sum=0; jl[0]=1000; while(jl[sum]>0){sum++;k=k+2;jl[sum]=jl[sum-1]-500/k;y[sum]=sum*500;} cout<<"i=0 dis=0.00 oil=3875.00"<<endl; for(int i=1;i<=sum-1;i++) {cout<<"i="<<i<<" dis="<<jl[8-i]<<".00 oil="<<y[8-i]<<".00"<<endl;} }