benchmarks.wiki / Public workspace

MMLU-Pro / 10703 / If we have a list of tabular values represented by a one-dimensionalar-ray, then…

Problem

Answer published by the source. Consult the official source to check your work against its answer.

question

If we have a list of tabular values represented by a one-dimensionalar-ray, then the first differences of the list areformed by subtracting each element except the last [sincenothing follows the last element] from the element immediatelyfollowing it. Suppose we have a one--dimensionalarray named X that contains 50 elements. Compute the 49 elements of another array named DX from DX(I) = X(I + 1) - X(I) I = 1,2,...,49. Write a program segment to perform this calculation.

category

computer science

options

  1. DIMENSIONX(50), DX(49) DO 50 I = 1, 50 50DX(I) = X(I + 1) - X(I) STOP END
  2. DIMENSION X(50) DIMENSION DX(50) DO 50 I = 1, 49 50 DX(I) = X(I + 2) - X(I) STOP END
  3. DIMENSION X(50), DX(48) DO 50 I = 1, 48 50 DX(I) = X(I + 1) - X(I) STOP END
  4. DIMENSION X(50), DX(49) FOR I = 1 TO 49 DX(I) = X(I) - X(I + 1) NEXT I STOP END
  5. DIMENSIONX(50), DX(49) DO 50 I = 1, 49 50DX(I) = X(I + 1) - X(I) STOP END
  6. DIMENSIONX(50), DX(50) DO 50 I = 1, 49 50DX(I) = X(I) - X(I+1) STOP END
  7. DIMENSION X(50), DX(49) DO 50 I = 2, 50 50 DX(I-1) = X(I) - X(I - 1) STOP END
  8. DIMENSIONX(49), DX(50) DO 50 I = 1, 49 50DX(I) = X(I + 1) - X(I) STOP END
  9. DIMENSION X(51), DX(49) DO 50 I = 1, 49 50 DX(I) = X(I + 1) - X(I) STOP END
  10. DIMENSION X(50), DX(49) DO 50 I = 1, 48 50 DX(I) = X(I + 2) - X(I + 1) STOP END

src

stemez-ComputerScience

Discussion

Discussion

No discussion posts on this page yet. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

Source and history

Official source

initial import