刚学没多久,不懂是什么原因。
#include
#include
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char argv[]) {
int d,g=32,t,sum=0;
for(t=0;t<11;t++){
d=1g*pow(t,2)/2;
sum+=d;
cout<<"time is:"<<t<<endl;
cout<<"Distance in the Current Time Interval (ft):"<<d<<endl;
cout<<"Total Distance (ft):"<<sum<<endl;
}
return 0;
}
如图,遇到400,1600等就会变成399,1599,请问要怎么解决