#include
#include
using namespace std;
int n;
string days[]={“Monday”,“Tuesday”,“Wednesday”,“Thursday”,“Friday”,“Saturday”,“Sunday”};
int main()
{
//scanf("%d",&n);
cin>>n;
if(n<1||n>7)
//printf(“illegal”);
cout<<“illegal”;
else
//cout<<days[n-1];
printf("%s",days[n-1]);// why doesn’t this compile OK? C函数不熟悉C++结构
return 0;
}
第16行编译报错,通过网络查看得到解决方法:C函数不熟悉C++结构 ,原话这么说
C functions are not acquainted with C++ structures. You should do the following:
…
for(i = 0; i < 6; i++) {
printf(“Input the number for %s =”, qr_naziv[i].c_str());
scanf("%d", &br_el[i]);
}