当前位置:首页 » 编程语言 » evaluateto在c语言
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

evaluateto在c语言

发布时间: 2022-10-19 08:59:31

‘壹’ c语言term does not evaluate to a function

1, 定义的变量,要放在输出的前面,(有些编译器会报错,要先定义变量在使用输出)2.、

你定义的变量名和函数名相同会报错,把inthnt;换成其他的变量就行了

#include<stdio.h>
inthnt(intx);
intmain()
{
inta;

printf("汉诺塔游戏 ");
scanf("%d",&a);
printf("需要移动%d次",hnt(a));
return0;
}
inthnt(intx)
{
inthnt1;
if(x>1)
hnt1=2*hnt(x-1)+1;
else
hnt1=1;
returnhnt1;
}

‘贰’ C语言 出现terms does not evaluate to a function错误

#include<stdio.h>
intmain()
{
longn=1,m=1;
for(m=1;m<100000;m++){
for(n=1;n<100000;n++){
if(n*n==(m*(m+1))/2){
printf("n=%d,m=%d ",n,m);
break;
}
}
}
return0;
}

‘叁’ c语言term does not evaluate to a function

其实就是提示你,你的返回类型是void但是你却在程序最后return 了,,,这样就矛盾了,,,如果你定义了int 但是没有return,会提示你,**must have return a value ,,,,
再就是了,,,你的程序里面有很多的错误,()错误,因该为[]表示下标运算符,再就是了,及时可以返回值,你return m[i]表示返回一个值,而非地址,或者拍好了了的,数组名,,,
再就是了你的冒泡排序存在问题,因该是
我给你修改了,,你看一下,
//#include<string.h> //为什么要加这么多的头文件,?好看?不适用,建议你看一下,每个头文件都包含那些关键字或函数
//#include<stdlib.h> //调用malloc时必须,否则会导致错误
#include<stdio.h>
//#include<ctype.h>
//#include<conio.h> // getch() 暂定作用,输入一个数但是不显示在屏幕上,可以这样测试 printf("%c",getch());
void proc(char* m,int num)
{
int i,j;
char c;
for(i=0;i<num;i++) //从零开始比较,虽然你定义了一个10元素,但是在下面的实参中是9,为什么还要-1

{
for(j=i+1;j<num;j++)

if(m[i]>m[j])
{ c=m[j]; // 不要拉上这个{,因为这个三部都属于if语句
m[j]=m[i];
m[i]=c;
}
}

}
void main()
{
char t[10];
gets(t); //对这里相对了,其职能输入9个,因为最后那个要作为'\0',
proc(t,9);
printf("\n%s",t);

}

返回情况

#include<stdio.h>

char *proc(char* m,int num) // 返回值为指针类型
{
int i,j;
char c;
for(i=0;i<num;i++)

{
for(j=i+1;j<num;j++)

if(m[i]>m[j])
{ c=m[j];
m[j]=m[i];
m[i]=c;
}
}
return m;// m作为数组名返回,其实是一个指针,
}
void main()
{
char t[10];
gets(t);

printf("\n%s",proc(t,9));

}

‘肆’ C语言 term does not evaluate to a function 如何修改

//不知道你要表达什么意思,看看是不是要这个效果,在VC6。0中通过,
#include<stdio.h>
#include<math.h>
void main ()
{
unsigned int n;
int k,a,b=0;
printf("Input a number n(0<n<65536):");
scanf("%d",&n);
k=1+(n>9)+(n>99)+(n>999)+(n>9999); /*判断n的位数*/
printf("%d\n",k);
for (;k>=1;k--)
{
a=n/pow(10,k-1);
n%=(int)pow(10,k-1);
b+=a;
printf("%d ",a);
}
printf("\n%d\n",b);
}

‘伍’ C语言问题。term does not evaluate to a function

没有时间看你的算法
printf("%d",d+e+f+c/4+1(a-(9*e+(4-c%4)*5+(4*d+4-c%4-b)*4))/36);
这一句错误在这里+1(a
其他几句都有类似错误
+1(a
1和(之间应该有运算符

‘陆’ 在c语言中出现term does not evaluate to a function是什么意思

//不知道你要表达什么意思,看看是不是要这个效果,在VC6。0中通过,
#include<stdio.h>
#include<math.h>
void main ()
{
unsigned int n;
int k,a,b=0;
printf("Input a number n(0<n<65536):");
scanf("%d",&n);
k=1+(n>9)+(n>99)+(n>999)+(n>9999); /*判断n的位数*/
printf("%d\n",k);
for (;k>=1;k--)
{
a=n/pow(10,k-1);
n%=(int)pow(10,k-1);
b+=a;
printf("%d ",a);
}
printf("\n%d\n",b);
}