☕ Java Help - Reverse string in a 2d array

Status
Not open for further replies.

PHC-Jayce

Established
Meron akong 2d array na may 2 row at 2 col at ito ang laman nila

hak dog
hak dog

Question: Ano po ba pweding gawin para maging

kah god
kah god

Maraming salamat po in advance
 
Traditional method (using loops and procedural) that is intended for beginners.
Hope this helps..
Code:
for i=0 to arr.length-1
  for j=0 to arr[i].length-1
    set text=arr[i][j]
    for c=text.length to 0
      print text.charAt(c)
    next c
    print " "
  next j
  print "\n"
next i
 
Traditional method (using loops and procedural) that is intended for beginners.
Hope this helps..
Code:
for i=0 to arr.length-1
  for j=0 to arr[i].length-1
    set text=arr[i][j]
    for c=text.length to 0
      print text.charAt(c)
    next c
    print " "
  next j
  print "\n"
next i
pano i solve yung issue na isang line lang na piprint idol?
1663511602114.webp
 
Sa first loop mo yan kung isang line lang.
The first loop reads the array row, 2nd loop read each column (sub array), and the 3rd loop reverses the reading of the string.

Post mo code mo para ma examine ko. Good job nga pala kase nakuha mo yung pseudocode or concept na napost ko..
 
Sa first loop mo yan kung isang line lang.
The first loop reads the array row, 2nd loop read each column (sub array), and the 3rd loop reverses the reading of the string.

Post mo code mo para ma examine ko. Good job nga pala kase nakuha mo yung pseudocode or concept na napost ko..
Okay na idol na debug ko na kanina maraming salamat po
 
Status
Not open for further replies.

About this Thread

  • 4
    Replies
  • 583
    Views
  • 2
    Participants
Last reply from:
PHC-Jayce

Trending Topics

Online now

Members online
1,211
Guests online
3,579
Total visitors
4,790

Forum statistics

Threads
2,278,296
Posts
28,982,245
Members
1,228,298
Latest member
HYI
Back
Top