关于一个较为简单的C++程序
include<iostream>longdoublefrrto(longdouble)intmain(){usingnamespacestd;longdoubleyen...
include<iostream>
long double frrto(long double)
int main()
{
using namespace std;
long double yen;
cout<<"Enter the yen:";
cin>>yen;
long double yen=long double frrto (yuan);
cout<<yen<<"yen=";
cout<<yuan<<"yuan"<<endl;
return 0:
}
long double frrto(long double sts)
{
return 0.06035*sts;
}
请问这条程序有没有问题?如果有的话请版主我改正,并告诉我如何编译? 展开
long double frrto(long double)
int main()
{
using namespace std;
long double yen;
cout<<"Enter the yen:";
cin>>yen;
long double yen=long double frrto (yuan);
cout<<yen<<"yen=";
cout<<yuan<<"yuan"<<endl;
return 0:
}
long double frrto(long double sts)
{
return 0.06035*sts;
}
请问这条程序有没有问题?如果有的话请版主我改正,并告诉我如何编译? 展开
2个回答
展开全部
#include<iostream>
long double frrto(long double) ; //少分号
int main()
{
using namespace std;
long double yen;
cout<<"Enter the yen:";
cin>>yen;
long double yuan=frrto (yen); //变量写反了吧?! 函数调用不要加类型定义
cout<<yen<<"yen=";
cout<<yuan<<"yuan"<<endl;
return 0; //应该是分号
}
long double frrto(long double sts)
{
return (long double)0.06035*sts;
}
推荐于2017-10-04
展开全部
#include<iostream> //少个#
long double frrto(long double); //少个;
int main()
{
using namespace std;
long double yen;
cout<<"Enter the yen:";
cin>>yen;
long double yuan=frrto (yen); //去掉long double
cout<<yen<<"yen=";
cout<<yuan<<"yuan"<<endl;
return 0; //用;
}
long double frrto(long double sts)
{
return 0.06035*sts;
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询