fork download
  1. #include <stdio.h>
  2.  
  3.  
  4. #define N 3
  5. #define M 3
  6. #define A 0.0
  7. #define B 1.0
  8. #define C 0.0
  9. #define D 1.0
  10.  
  11.  
  12. int main(){
  13. double h_x;
  14. h_x= (double) 1/(N+1);
  15. double h_y;
  16. h_y= (double) 1/(M+1);
  17. double X[N+2];
  18. double Y[M+2];
  19. double xhalf[N+1];
  20. double yhalf[M+1];
  21. int i,j;
  22. double o,k,l;
  23.  
  24. X[0]=C; X[N+2]=D; Y[0]=C; Y[M+2]=D; xhalf[0]=h_x/2; yhalf[0]=h_y/2;
  25. for(i=1; i<=N; i++)
  26. {
  27.  
  28. X[i]= X[i-1]+h_x;
  29. xhalf[i]=xhalf[i-1]+h_x;
  30. printf("%e\n", X[i]);
  31. }
  32. for(i=1; i<=M; i++)
  33. {
  34.  
  35. Y[i]=Y[i-1]+h_y;
  36. yhalf[i]=yhalf[i-1]+h_y;
  37. printf("%e\n", Y[i]);
  38. }
  39. return 0;
  40. }
  41.  
Success #stdin #stdout 0s 2160KB
stdin
Standard input is empty
stdout
2.500000e-01
5.000000e-01
7.500000e-01
2.500000e-01
5.000000e-01
7.500000e-01