0
启动时的for循环,我想使用此代码变量for循环
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
double t,m,x,z,k,v,n ;
k = (1.38065*(pow (10,-23)));
cout<< "input value a: " ;
cin >> m ;
cout<< "Input value b: " ;
cin >> t ;
cout<< "Input value c:" ;
cin >> x ;
cout<< "Input value d. :" ;
cin >> n ;
for
(z=t ; z<x ; z+=n) ;
v = sqrt(((2*k)*t)/m) ;
cout<< " value of v after the loop using n as loop spacing " ;
cout<< v <<endl ;
用户使用输入的数值有我使用了错误的循环还是我失去了一些关键部分的代码如果我刚刚错过了以前的话题,可以将其链接到我先前提供的感谢
为什么在循环后面有';'。如果你打算包含'v = sqrt(((2 * k)* t)/ m);'在循环范围内移除';' – Danny 2012-01-10 14:52:33