首页 > 用户发贴区 > 编程问题提问区 > 实参与行参 调试不通过?
2008
10-19

实参与行参 调试不通过?

大家好,下面是利用VC调的程序,总是通不过,请大家帮忙指正错误,谢谢!


#include”stdio.h”
void main()
{
int n;
int s(n);
int sum;
printf(“input number\n”);
scanf(“%d”,&n);
sum=s(n);
printf(“sum=%d\n”,sum);
}
int s(int m)
{
int i;
for(i=m-1;i>=1;i–)
m=m+i;
printf(“m=%d\n”,m);
return s(m);
}


——————–Configuration: 实参与行参 – Win32 Debug——————–
Compiling…
实参与行参.cpp
D:\工作\电子\C语言\C语言程序300例代码\实参与行参.cpp(9) : error C2064: term does not evaluate to a function
Error executing cl.exe.


实参与行参.exe – 1 error(s), 0 warning(s)


 


实参与行参 调试不通过?》有 3 条评论

  1. Perfect 说:

    int s(n);

    这一句有问题

    函数声明必须说明函数的参数类型

    应该是int s(int);

  2. woshiagun 说:

    问题解决了,谢谢!

  3. weiwei14756 说:

    77var i,url;
    var NowPage,AllPageCount,PageCount,AllPage;
    var BackNext;
    <%=AllPage %>
    PageCount=37;
    BackNext=5;
    if(AllPageCount%PageCount==0)
    {
        AllPage=AllPageCount/PageCount;
    }
    else
    {
        AllPage=parseInt(AllPageCount/PageCount)+1;
    }
       url=”"+document.location;
       i=parseInt(url.substring(url.lastIndexOf(‘_’)+1,url.lastIndexOf(‘.’)));
       if(i==0)
       {
               i=1;
       }
       url=url.substring(0,url.lastIndexOf(‘_’));
       NowPage=i;
       function PageCountLoad()
       {
               var _html=”页次:” + NowPage + “/” + AllPage +”页&nbsp;&nbsp;每页”+ PageCount + “条&nbsp;&nbsp;共” + AllPageCount + “条记录”;
            if(i!=1)
            {
                _html+=”&nbsp;&nbsp;<a href=’” + url + “_1.html’ class=’PageCount’>首页</a>&nbsp;<a href=’” + url + “_” + (NowPage-1) +”.html’ class=’PageCount’>上一页</a>&nbsp;”;
            }
            else
            {
                _html+=”&nbsp;&nbsp;首页&nbsp;上一页&nbsp;”;
            }
            var StartPage,EndPage;
            if((NowPage-BackNext)>1)
            {
                StartPage=NowPage-BackNext;
            }
            else
            {
                StartPage=1;
            }
            if((NowPage+BackNext)<=AllPage)
            {
                EndPage=NowPage+BackNext;
            }
            else
            {
                EndPage=AllPage;
            }
            var _Menu=”";
            for(;StartPage<=EndPage;StartPage++)
            {
                if(StartPage!=NowPage)
                {
                    _Menu +=”<a href=’” + url + “_” + StartPage + “.html’ class=’PageCount’>” + StartPage + “</a>&nbsp;”;
                }
                else
                {
                    _Menu +=”<font color=’red’>[" + StartPage + "</a>]</font>&nbsp;”;
                }
            }
            _html+=_Menu;
            if(NowPage!=EndPage)
            {
                _html +=”&nbsp;<a href=’” + url + “_” + (NowPage+1) + “.html’ class=’PageCount’>下一页</a>”;
            }
            _html +=”&nbsp;<a href=’” + url + “_” + AllPage + “.html’ class=’PageCount’>尾页</a>”;
            document.write(_html);
       }

留下一个回复