SlepoiKrot

Untitled

Feb 3rd, 2018
95
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program Project2;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. uses
  6. SysUtils;
  7. var
  8. a: array [1..2001, 1..2001] of char;
  9. i, u, k, j, n, m, i2: integer;
  10. x: char;
  11. begin
  12. readln (n, m, k);
  13. i2 := 0;
  14. u := 0;
  15.  
  16.  
  17. for i := 1 to n do begin
  18. for j := 1 to m do begin
  19. if (a[i, j] = '.') and (u = 0) then
  20. inc (u);
  21. if ((a[i, j] = '.') and (a[i, j+1] = '.')) then begin
  22. inc (u);
  23. if (u = k) then
  24. inc (i2);
  25. if (u > k) then
  26. inc (i2);
  27. end
  28. else
  29. u := 0;
  30. if (a[i, j + 1] <> '.') and (a[i, j + 1] <> '*') then
  31. break;
  32. writeln (a[i, j], ' ', a[i, j+1]);
  33. end;
  34. end;
  35. i2 := 0;
  36. u := 0;
  37. for i := 1 to n do begin
  38. for j := 1 to m do begin
  39. if ((a[i, j] = '.') and (a[i+1, j] = '.')) then begin
  40. inc (u);
  41. if (u = k) then
  42. inc (i2);
  43. if (u > k) then
  44. inc (i2);
  45. end
  46. else
  47. u := 0;
  48. end;
  49. end;
  50. writeln (i2);
  51. readln;
  52. readln;
  53. end.
RAW Paste Data