fork download
  1. #include <iostream>
  2. #include <time.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. int n,m; scanf("%d %d", &n, &m);
  7. srand(time(0));
  8. for(int i = 0; i < n; i++){
  9. for(int j = 0; j < m; j++)
  10. printf("%4.1lf ",(rand()%200-100)/10.);
  11. printf("\n");
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0s 3300KB
stdin
2 4
stdout
-4.0  1.7  4.0  7.0 
 1.7  7.4 -2.4  1.2