| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1171 人关注过本帖
标题:请各位看看,这个简单的程序为什么运行报错呢?
取消只看楼主 加入收藏
lj120122
Rank: 1
等 级:新手上路
帖 子:23
专家分:8
注 册:2012-11-26
结帖率:50%
收藏
已结贴  问题点数:20 回复次数:4 
请各位看看,这个简单的程序为什么运行报错呢?
#include<stdio.h>
void main()
{
    int a[10];
    for(int i=0;i<10;i++)
    scanf("%d",&a[i]);
    printf("\n");
    for(int j=0;j<10;j++)
    printf("%d",a[i]);
    printf("\n");
}
搜索更多相关主题的帖子: 看看 
2013-03-11 20:44
lj120122
Rank: 1
等 级:新手上路
帖 子:23
专家分:8
注 册:2012-11-26
收藏
得分:0 
回复 2楼 未名湖的云
不好意思,写错了,是j,请指点一下!
2013-03-11 21:03
lj120122
Rank: 1
等 级:新手上路
帖 子:23
专家分:8
注 册:2012-11-26
收藏
得分:0 
回复 4楼 未名湖的云
e:\download\notepad++\test.c(7) : error C2143: syntax error : missing ';' before 'type'
e:\download\notepad++\test.c(7) : error C2143: syntax error : missing ';' before 'type'
e:\download\notepad++\test.c(7) : error C2143: syntax error : missing ')' before 'type'
e:\download\notepad++\test.c(7) : error C2143: syntax error : missing ';' before 'type'
e:\download\notepad++\test.c(7) : error C2065: 'i' : undeclared identifier
e:\download\notepad++\test.c(7) : warning C4552: '<' : operator has no effect; expected operator with side-effect
e:\download\notepad++\test.c(7) : error C2059: syntax error : ')'
e:\download\notepad++\test.c(8) : error C2146: syntax error : missing ';' before identifier 'scanf'
e:\download\notepad++\test.c(10) : error C2143: syntax error : missing ';' before 'type'
e:\download\notepad++\test.c(10) : error C2143: syntax error : missing ';' before 'type'
e:\download\notepad++\test.c(10) : error C2143: syntax error : missing ')' before 'type'
e:\download\notepad++\test.c(10) : error C2143: syntax error : missing ';' before 'type'
e:\download\notepad++\test.c(10) : error C2065: 'j' : undeclared identifier
e:\download\notepad++\test.c(10) : warning C4552: '<' : operator has no effect; expected operator with side-effect
e:\download\notepad++\test.c(10) : error C2059: syntax error : ')'
e:\download\notepad++\test.c(11) : error C2146: syntax error : missing ';' before identifier 'printf'
2013-03-11 21:16
lj120122
Rank: 1
等 级:新手上路
帖 子:23
专家分:8
注 册:2012-11-26
收藏
得分:0 
回复 4楼 未名湖的云
e:\download\notepad++\test.c(7) : error C2143: syntax error : missing ';' before 'type'
e:\download\notepad++\test.c(7) : error C2143: syntax error : missing ';' before 'type'
e:\download\notepad++\test.c(7) : error C2143: syntax error : missing ')' before 'type'
e:\download\notepad++\test.c(7) : error C2143: syntax error : missing ';' before 'type'
e:\download\notepad++\test.c(7) : error C2065: 'i' : undeclared identifier
e:\download\notepad++\test.c(7) : warning C4552: '<' : operator has no effect; expected operator with side-effect
e:\download\notepad++\test.c(7) : error C2059: syntax error : ')'
e:\download\notepad++\test.c(8) : error C2146: syntax error : missing ';' before identifier 'scanf'
e:\download\notepad++\test.c(10) : error C2143: syntax error : missing ';' before 'type'
e:\download\notepad++\test.c(10) : error C2143: syntax error : missing ';' before 'type'
e:\download\notepad++\test.c(10) : error C2143: syntax error : missing ')' before 'type'
e:\download\notepad++\test.c(10) : error C2143: syntax error : missing ';' before 'type'
e:\download\notepad++\test.c(10) : error C2065: 'j' : undeclared identifier
e:\download\notepad++\test.c(10) : warning C4552: '<' : operator has no effect; expected operator with side-effect
e:\download\notepad++\test.c(10) : error C2059: syntax error : ')'
e:\download\notepad++\test.c(11) : error C2146: syntax error : missing ';' before identifier 'printf'
2013-03-11 21:16
lj120122
Rank: 1
等 级:新手上路
帖 子:23
专家分:8
注 册:2012-11-26
收藏
得分:0 
回复 10楼 a77232923
我就是在两个for循环里分别定义啊,但是运行就是出错!要是在开头定义int i,j就没错。
2013-03-12 21:42
快速回复:请各位看看,这个简单的程序为什么运行报错呢?
数据加载中...
 
   



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

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