sscanf()使うなら、intの一時変数を利用すればいいね。
つまり、
sscanf(temp,"%d",&a[x][y][c]);
じゃなくて
int tmpVal;
sscanf(temp, "%d", &tmpVal);
a[x][y][c] = tmpVal;