Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 aother one
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
baby girl




PostPosted: Tue Dec 10, 2002 9:33 am   Post subject: aother one

write a program witch asks the user to enter a word and it outputs the word reverse.
one example is time : emit
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Dec 10, 2002 12:13 pm   Post subject: (No subject)

same as before, its about selecting a part of the string... In reverse order that is:

for decreasing i:length(text)..1
put text(i)..
end for

runs loop from last letter to first, outputing 1 letter at a time. Don't forget .. to have word appear on same line.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
baby girl




PostPosted: Fri Dec 13, 2002 10:47 am   Post subject: (No subject)

for decreasing i:length(text)..1
put text(i).. i dont get that
?? i do it and it has a error
can you make the word "baby" reverse for me?
Tony




PostPosted: Fri Dec 13, 2002 2:44 pm   Post subject: (No subject)

what kind of error are you getting? maybe you forgot to declear the variable?

code:

var text:string := "tony"
for decreasing i:length(text)..1
put text(i)..
end for


output will be "ynot"
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: