怎么把下面C++程序的内容在EXCEL里面用VBA编写,只要求得到e
#include<iostream>usingnamespacestd;voidmain(){doublek1,k2,t1,t2,c,d,e;cout<<"printk1...
#include<iostream>
using namespace std;
void main()
{
double k1,k2,t1,t2,c,d,e;
cout<<"print k1,k2,t1,t2="<<endl;
cin>>k1>>k2>>t1>>t2;
c=6.28*k1*t2-6.28*k2*t1;
d=t1*t1*t2-t2*t2*t1;
e=c/d;
cout<<"c="<<c<<endl;
cout<<"d="<<d<<endl;
cout<<"e="<<e<<endl;
}
呐就是在EXCEL中编这样一个函数
e=6.28(k1*t2-k2*t1)/t1*t1*t2-t2*t2*t1
说得好加分 展开
using namespace std;
void main()
{
double k1,k2,t1,t2,c,d,e;
cout<<"print k1,k2,t1,t2="<<endl;
cin>>k1>>k2>>t1>>t2;
c=6.28*k1*t2-6.28*k2*t1;
d=t1*t1*t2-t2*t2*t1;
e=c/d;
cout<<"c="<<c<<endl;
cout<<"d="<<d<<endl;
cout<<"e="<<e<<endl;
}
呐就是在EXCEL中编这样一个函数
e=6.28(k1*t2-k2*t1)/t1*t1*t2-t2*t2*t1
说得好加分 展开
2个回答
展开全部
貌似不可以吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
输入1,2,3,4,e=1.046666....,函数下面这样:
Sub CPlus()
Dim k1 As Double, k2 As Double, t1 As Double, t2 As Double
Dim c As Double, d As Double, e As Double
k1 = InputBox("k1=")
k2 = InputBox("k2=")
t1 = InputBox("t1=")
t2 = InputBox("t2=")
c = 6.28 * k1 * t2 - 6.28 * k2 * t1
d = t1 * t1 * t2 - t2 * t2 * t1
e = c / d
MsgBox "c=" & c & " d=" & d & " e=" & e
End Sub
Sub CPlus()
Dim k1 As Double, k2 As Double, t1 As Double, t2 As Double
Dim c As Double, d As Double, e As Double
k1 = InputBox("k1=")
k2 = InputBox("k2=")
t1 = InputBox("t1=")
t2 = InputBox("t2=")
c = 6.28 * k1 * t2 - 6.28 * k2 * t1
d = t1 * t1 * t2 - t2 * t2 * t1
e = c / d
MsgBox "c=" & c & " d=" & d & " e=" & e
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询