蓝桥杯决赛愤怒的小鸟

xiaoxiao2021-02-27  425

简单的模拟一下,以0.00001秒的速度前进 #include <stdio.h> #include <bits/stdc++.h> #define read(); freopen("input.txt","r",stdin); using namespace std; int main() { double l=0,r=1000,frid=0;int t=0,k=1; while(r-l>1){ if(frid>=r){ k=-1;t++;frid=r-(frid-r); } if(frid<=l){ k=1;frid=l+(l-frid); } l+=0.00001*10;r-=0.00001*10;frid+=0.00001*50*k; } cout<<t<<endl; return 0; }
转载请注明原文地址: https://www.6miu.com/read-2724.html

最新回复(0)