C++链接数据库执行sql语句时,表达式必须包含整数或枚举类型
charFJH,KHSH;cout<<"请输入分机号"<<endl;cin>>FJH;cout<<"请输入客户税号"<<endl;cin>>KHSH;try{m_pRec...
char FJH,KHSH;
cout<<"请输入分机号"<<endl;
cin>>FJH;
cout<<"请输入客户税号"<<endl;
cin>>KHSH;
try
{
m_pRecordset->Open("select cpzt from XSGL_YDKPZC where fjh="+FJH+" and khsh="+KHSH,(IDispatch*)sqlSp,adOpenDynamic,adLockOptimistic, adCmdText);
}
catch (_com_error &e)
{
cout << e.Description()<<endl;
} 展开
cout<<"请输入分机号"<<endl;
cin>>FJH;
cout<<"请输入客户税号"<<endl;
cin>>KHSH;
try
{
m_pRecordset->Open("select cpzt from XSGL_YDKPZC where fjh="+FJH+" and khsh="+KHSH,(IDispatch*)sqlSp,adOpenDynamic,adLockOptimistic, adCmdText);
}
catch (_com_error &e)
{
cout << e.Description()<<endl;
} 展开
1个回答
展开全部
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int i,k;
int m;
cout<<"输入一个大于1的正整数m:"<<endl;
cin>>m;
if(m==2)
cout<<m<<"不是素数."<<endl;
else
{
k=(int)sqrt((double)m);
for(i=2;i<=k;i++)
if(m%i==0) break;
if(i>k)
cout<<m<<"是素数."<<endl;
else
cout<<m<<"不是素数."<<endl;
}
return 0;
}
#include <cmath>
using namespace std;
int main()
{
int i,k;
int m;
cout<<"输入一个大于1的正整数m:"<<endl;
cin>>m;
if(m==2)
cout<<m<<"不是素数."<<endl;
else
{
k=(int)sqrt((double)m);
for(i=2;i<=k;i++)
if(m%i==0) break;
if(i>k)
cout<<m<<"是素数."<<endl;
else
cout<<m<<"不是素数."<<endl;
}
return 0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询