开发平台(Platform):W7
编译器:Dev c++
额外使用到的函数库(Library Used): (Ex: OpenGL, ...)
问题(Question):
二维阵列输入 输出:
新手自学,依照书本上的进行,但输出却是乱数@@!
检查不出来为什么QQ
喂入的资料(Input):
输入 1,2,3,4,5,6
预期的正确结果(Expected Output):
输出 1,2,3
4,5,5
错误结果(Wrong Output):
一串数字
" target="_blank">
" class="img-responsive" />程式码(Code):
好读图片:
" target="_blank">
" class="img-responsive" />#include <stdio.h>
#include <stdlib.h>
#define CLASS 2
#define STUDENT 3
int main(){
int score[CLASS][STUDENT];
int i,j;
for (i=0;i<CLASS;i++){
for(j=0;j<STUDENT;j++){
scanf("%d",&score[i][j]);
}
}
for (i=0;i<CLASS;i++){
for(j=0;j<STUDENT;j++){
printf("%d",&score[i][j]);
}
}
return 0;
}
补充说明(Supplement):
我即使把输入改掉,直接喂资料
int score[2][3]={1,2,3,4,5,6}
输出也是乱数,不知道为什么
新手上路,如果问题太笨请多包涵