sondos
31-10-2005, 10:30 AM
السلام عليكم
ممكن اتوضحون لي السؤال لاني ما فهمته
كيف يمكن استخدم ال* كسطر جديد في البرمجة
وهذا نص السؤال لان عليه 30 درجة
In this question you are asked to design and write a C++ program whose purpose
is as follows. A string value is to be read in from the keyboard. The string will
comprise a name and address with the elements separated by asterisks, such as
John Smith*123 The Avenue*SomeTown*B91 1NP
The program has to write this string out in the following format.
John Smith
123 The Avenue
SomeTown
B911NP
The number of elements in the string entry (which will become the number of lines
in the written-out format) is not fixed. That is, the number of asterisks in the input
string is not known in advance.
You should base your design on first reading in the string to be formatted and then writing
out the revised string. Do not attempt to write out the characters as you read them in. Your
program should handle whatever input string is received from the user. For example, if the
user enters a string with no asterisks included, your program should write out this same
string. Every asterisk should produce a new line in the output.
وشكرا لكل المشاركين
ممكن اتوضحون لي السؤال لاني ما فهمته
كيف يمكن استخدم ال* كسطر جديد في البرمجة
وهذا نص السؤال لان عليه 30 درجة
In this question you are asked to design and write a C++ program whose purpose
is as follows. A string value is to be read in from the keyboard. The string will
comprise a name and address with the elements separated by asterisks, such as
John Smith*123 The Avenue*SomeTown*B91 1NP
The program has to write this string out in the following format.
John Smith
123 The Avenue
SomeTown
B911NP
The number of elements in the string entry (which will become the number of lines
in the written-out format) is not fixed. That is, the number of asterisks in the input
string is not known in advance.
You should base your design on first reading in the string to be formatted and then writing
out the revised string. Do not attempt to write out the characters as you read them in. Your
program should handle whatever input string is received from the user. For example, if the
user enters a string with no asterisks included, your program should write out this same
string. Every asterisk should produce a new line in the output.
وشكرا لكل المشاركين