开发平台(Platform): (Ex: VC++, GCC, Linux, ...)
Dev-C++
额外使用到的函数库(Library Used): (Ex: OpenGL, ...)
NO 只有基本的 include <stdio.h>
问题(Question):
抓阵列取值有时会出错
喂入的资料(Input):
预期的正确结果(Expected Output):
如图。阵列值都是一。
错误结果(Wrong Output):
可是当N 变大时等于60, 他会出现 2292658 这种怪数字。
可是 N=99 又没问题。 不知道为什么,求大师解救。
程式码(Code):(请善用置底文网页, 记得排版)
#include <stdio.h>
#define N 60
int main(){
int score1[N],score2[N];
int i,j,s=0,ds=0;
// 输入两个长度100的数列
for (i=1;i<=N;i++){
score1[i]=1,score2[i]=1 ;
printf("%6d\n",score1[i]);
printf("%6d\n",score2[i]);
printf("%6s\n","