#8050: 記憶體區段錯誤...


eszedcsd (EXport)


#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
  int t=0; 
  int l[5];
  scanf("%i",&t); 
  while(t!=0){
    scanf("%i %i %i %i",l[0],l[1],l[2],l[3]); 
    if(l[0]*l[3] == l[1]*l[2])l[4]=l[3]*(l[3]/l[2]); 
    else l[4]=l[3]+(l[3]-l[2]); 
    printf("%i %i %i %i %i",l[0],l[1],l[2],l[3],l[4]); 
    t--; 
  } 
  
  
  return 0;
}
 
有沒有人可以幫我看一下是哪裡的問題OTZ 
#8051: Re:記憶體區段錯誤...


eszedcsd (EXport)



    scanf("%i %i %i %i",l[0],l[1],l[2],l[3]); 
 
 
 
自解了...
 
原來要改裡面的值要用&取址給韓式去改, 

        scanf("%i %i %i %i",&l[0],&l[1],&l[2],&l[3]);