| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 362 人关注过本帖
标题:编译出错,求帮助
取消只看楼主 加入收藏
as66760
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2013-10-28
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:0 
编译出错,求帮助
#include<stdio.h>
int gcd (int x, int y);
int gcds(int *array,int len);
int main(void)
{
    int n;
    scanf("%d",&n);
    int array[n];
    for(int idx=0;idx<n;idx++)
    {
        scanf("%d",&array[idx]);
    }
    int now = gcds(array,n);
    printf("%d",now);
    return 0;
}
intgcd(int x,int y)
{
    if(y!=0)
        return gcd(y,x%y);
    else
        return x;
}
int gcds(int *array,int len)
{
if(len!=0)
    return gcd(*array,gcds(array+1,len-1));
else
    return *array
}








--------------------Configuration: 333 - Win32 Debug--------------------
Compiling...
333.C
C:\Program Files\Microsoft Visual Studio\MyProjects\333\333.C(8) : error C2143: syntax error : missing ';' before 'type'
C:\Program Files\Microsoft Visual Studio\MyProjects\333\333.C(9) : error C2143: syntax error : missing ';' before 'type'
C:\Program Files\Microsoft Visual Studio\MyProjects\333\333.C(9) : error C2143: syntax error : missing ';' before 'type'
C:\Program Files\Microsoft Visual Studio\MyProjects\333\333.C(9) : error C2143: syntax error : missing ')' before 'type'
C:\Program Files\Microsoft Visual Studio\MyProjects\333\333.C(9) : error C2143: syntax error : missing ';' before 'type'
C:\Program Files\Microsoft Visual Studio\MyProjects\333\333.C(9) : error C2065: 'idx' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\333\333.C(9) : warning C4552: '<' : operator has no effect; expected operator with side-effect
C:\Program Files\Microsoft Visual Studio\MyProjects\333\333.C(9) : error C2059: syntax error : ')'
C:\Program Files\Microsoft Visual Studio\MyProjects\333\333.C(10) : error C2143: syntax error : missing ';' before '{'
C:\Program Files\Microsoft Visual Studio\MyProjects\333\333.C(11) : error C2065: 'array' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\333\333.C(11) : error C2109: subscript requires array or pointer type
C:\Program Files\Microsoft Visual Studio\MyProjects\333\333.C(11) : error C2102: '&' requires l-value
C:\Program Files\Microsoft Visual Studio\MyProjects\333\333.C(13) : error C2143: syntax error : missing ';' before 'type'
C:\Program Files\Microsoft Visual Studio\MyProjects\333\333.C(14) : error C2065: 'now' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\333\333.C(30) : error C2143: syntax error : missing ';' before '}'
执行 cl.exe 时出错.

333.exe - 1 error(s), 0 warning(s)
搜索更多相关主题的帖子: include return 
2013-10-28 17:59
快速回复:编译出错,求帮助
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015138 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved