【发布时间】:2014-10-29 22:36:18
【问题描述】:
#include <stdio.h>
int main()
{
int a,i,b,c,d,e;
array[5]["b","c","d","e"]; // defining input characters as int
for(i=1;i<=a;i++)
{
for(j=0;j<=a;j++)
{
printf("Input number %d ",i);
scanf("%d",&array[j]); // every loop it goes diffrent valuable
}
}
printf("Your numbers %d"b,c,d,e,);
return 0;
}
我对您的评论进行了一些更改。 我想将每个数字分配给不同的变量。
【问题讨论】:
-
程序有未定义的行为。
-
既然可以使用数组,为什么会这样?
-
这不是变量的工作方式。查找数组。
-
array[5]["a","b","c","d","e"] array[j] // 在 scanf 中?并循环它
-
请阅读有关 C 的书籍。如果您仍有疑问,请发布用有效 C 编写的代码。