0 Daumen
246 Aufrufe

Gibt es Tippes wie ich den output zu input anpasse?

blob.png

Text erkannt:

messages mixed
A short C peogram is listed below. One block of the peogram is missing. Your challenge is to mateh the candidate block of cede lon the left) with the oetput that yould see if the block were inserted. Not all of the lines of output will be Mixed used, and some of the lines of eutput might be used more than once. Oraw lines connecting the candidate blocks of code with their matching command-line output. Messages
\( \begin{array}{ll}y=y+*_{7} & \text { 111 } 3459\end{array} \)
Mateh each \( y=y+2 z \) Fandidate with it \( (y>4) \) ut of the \( y=y-11 \) culle evtpits
8
'00 11
\( \begin{array}{lllllll}11 & 21 & 32 & 42 & 53\end{array} \)
\( \begin{array}{llll}\text { ige } 11 & 23 & 36 & 410\end{array} \)
\( \begin{array}{lllll}\mathrm{M} 2 & 14 & 25 & 36 & 47\end{array} \)

Avatar von

noch mal großes Bild um besser zu sehen

Meine Frage; Darf ich hier den Code ins Papier schreiben und dann die Lösung Vermutung , IcH muss nur raten duch Überlegung aber OHNE den Code zu schreiben?

blob.png

Text erkannt:

A short \( C \) program is listed below. One block of the program is missing. Your challenge is to match the candidate block of code (on the left) with the output that you'd see if the block were inserted. Not all of the lines of output will be used, and some of the lines of output might be used more than once. Draw lines connecting the candidate blocks of code with their matching command-line output.

blob.png

Text erkannt:

Candidates:
\( y=x-y \)
\( y=y+x_{i} \)
\( \begin{array}{ll}\text { Match each } & y=y+2 ; \\ \text { candidate with } & \text { if }(y>4)\end{array} \)
one of the \( \quad y=y-1 ; \)
possible outputs.
\( \mathbf{x}=\mathbf{x}+1 \)
\( y=y+x \)
if \( (y<5)\{ \)
\( \mathbf{x}=\mathbf{x}+1 \)
if \( (y<3) \) \( \mathbf{x}=\mathbf{x}-1 \)
\}
\( y=y+2 \)

blob.png

Text erkannt:

Possible output:
2246
113459
\( \begin{array}{lllllll} & 14 & 26 & 38\end{array} \)
\( \begin{array}{llll}02 & 14 & 36 & 48\end{array} \)
\( \begin{array}{lllll}0 & 11 & 21 & 32 & 42\end{array} \)
\( \begin{array}{lllll}11 & 21 & 32 & 42 & 53\end{array} \)
\( \begin{array}{lllll}00 & 11 & 23 & 36 & 410\end{array} \)
\( \begin{array}{lllll}02 & 14 & 25 & 36 & 47\end{array} \)

1 Antwort

0 Daumen
 
Beste Antwort

Gehe das Programm Zeile für Zeile durch und merke dir, welche Werte die Variablen nach der Zeile haben. Zum Beispiel

Anweisung
x
y
Ausgabe
int x = 0
0


int y = 0

0

while (x < 5)



x = x + 1
1


y = y + x

1

printf("%i%i ", x, y)


11
x = x + 1
2


while (x < 5)



x = x + 1
3


y = y + x

4

printf("%i%i", x, y)


34
\(\vdots\)



Avatar von 5,6 k

Here you are

blob.png

Text erkannt:

Possible output:

Looks good?

Stimmt so. Ich finde es wirklich keine gute Idee, dass Kommentar eine Mindestlänge von 12 Zeichen haben müssen.

Ein anderes Problem?

Stell deine Frage

Willkommen bei der Stacklounge! Stell deine Frage einfach und kostenlos

x
Made by a lovely community