Guest User

Untitled

a guest
Dec 16th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. int ws[t];
  2.  
  3. char *boards[t];
  4.  
  5. int sumhxw = 0;
  6.  
  7. for (int i = 0; i < t; i++) {
  8.  
  9. // printf("Please enter the h and w space separated of test case no. %d n", i + 1);
  10.  
  11. scanf("%d %d", &hs[i], &ws[i]);
  12.  
  13. // constraint 2. 1 <= h,w <= 2500
  14.  
  15. if (!(hs[i] >= 1 && hs[i] <= 2500) || !(ws[i] >= 1 && ws[i] <= 2500)) {
  16.  
  17. // printf("The value of h and w are not valid terminating the program n");
  18.  
  19. return -1;
  20.  
  21. }
  22.  
  23. boards[i] = malloc(hs[i] * ws[i]);
  24.  
  25. // printf("Please enter the board of test case no. %d n", i + 1);
  26.  
  27. scanf("%s", boards[i]);
  28. printf("%s",boards[i]);
  29.  
  30. sumhxw = sumhxw + (hs[i] * ws[i]);
  31.  
  32. }
Add Comment
Please, Sign In to add comment