how to solve this problem(posted again)
-
1111-----1 1 11------ 1111----1- --------111 --------111 --------111 hi, as the previous question may not so easy to see, so i post the question out again here.. this is just only a example, and using C++ to solve plenty of these similiar example. In this problem, you can ignore all the - simbol as they stand for the space only, and you can see that: the hole formed inside many 1 consider call void element=V; here v = 1 two 1 which is quite far away from others is call exceptional element=E,here E = 2; let the total number of 1 =A; here A = 22 i need to use the C++ to calculate the below result S = (A-E)/(A+V) for example this case s = (22-2)/(21+1)=0.91 So how to write a C++ program, to search for the void element V; the exception element E as well as the total number of 1 A and calculate the result?? i am so eager to know the knowledge about this, may anyone give me a hand??? Your great help will be appreciated!!, thank so much. please send to my email sinbearzc@hotmail.com if you can give me a help, thank..
-
1111-----1 1 11------ 1111----1- --------111 --------111 --------111 hi, as the previous question may not so easy to see, so i post the question out again here.. this is just only a example, and using C++ to solve plenty of these similiar example. In this problem, you can ignore all the - simbol as they stand for the space only, and you can see that: the hole formed inside many 1 consider call void element=V; here v = 1 two 1 which is quite far away from others is call exceptional element=E,here E = 2; let the total number of 1 =A; here A = 22 i need to use the C++ to calculate the below result S = (A-E)/(A+V) for example this case s = (22-2)/(21+1)=0.91 So how to write a C++ program, to search for the void element V; the exception element E as well as the total number of 1 A and calculate the result?? i am so eager to know the knowledge about this, may anyone give me a hand??? Your great help will be appreciated!!, thank so much. please send to my email sinbearzc@hotmail.com if you can give me a help, thank..
Your question is not clear at all. What are these spaces and '1' ? Is that data contained in a file that you need to read ? Or what ? :confused: When describing a problem, try to imagine people reading you. What you describe is just too abstract for us to understand (at least, for me to understand ;P )
sinbear wrote:
please send to my email sinbearzc@hotmail.com if you can give me a help, thank..
No way, this is a forum so if we have an answer, we'll post on the forum.
Cédric Moonen Software developer
Charting control [Updated - v1.1] -
1111-----1 1 11------ 1111----1- --------111 --------111 --------111 hi, as the previous question may not so easy to see, so i post the question out again here.. this is just only a example, and using C++ to solve plenty of these similiar example. In this problem, you can ignore all the - simbol as they stand for the space only, and you can see that: the hole formed inside many 1 consider call void element=V; here v = 1 two 1 which is quite far away from others is call exceptional element=E,here E = 2; let the total number of 1 =A; here A = 22 i need to use the C++ to calculate the below result S = (A-E)/(A+V) for example this case s = (22-2)/(21+1)=0.91 So how to write a C++ program, to search for the void element V; the exception element E as well as the total number of 1 A and calculate the result?? i am so eager to know the knowledge about this, may anyone give me a hand??? Your great help will be appreciated!!, thank so much. please send to my email sinbearzc@hotmail.com if you can give me a help, thank..
sinbear wrote:
the hole formed inside many 1 consider call void element=V; here v = 1
Here you mean this line
1 11------
yes? Did you make a mistake? Should the line be1-11------
? You say a hole inside many 1's. How many? In your example there are 3 1's.sinbear wrote:
two 1 which is quite far away from others is call exceptional element=E,here E = 2;
quite far does not explain enough. Do you mean when there is more than 1 space between the 1's? Your example shows multiple lines. How exactly do you read the numbers? Are they binary or ASCII, does the file also contain lines (with a CLLF at the end of each line) or is it a continuous stream? Before anybody can help you, you must answer all of my questions.
-
1111-----1 1 11------ 1111----1- --------111 --------111 --------111 hi, as the previous question may not so easy to see, so i post the question out again here.. this is just only a example, and using C++ to solve plenty of these similiar example. In this problem, you can ignore all the - simbol as they stand for the space only, and you can see that: the hole formed inside many 1 consider call void element=V; here v = 1 two 1 which is quite far away from others is call exceptional element=E,here E = 2; let the total number of 1 =A; here A = 22 i need to use the C++ to calculate the below result S = (A-E)/(A+V) for example this case s = (22-2)/(21+1)=0.91 So how to write a C++ program, to search for the void element V; the exception element E as well as the total number of 1 A and calculate the result?? i am so eager to know the knowledge about this, may anyone give me a hand??? Your great help will be appreciated!!, thank so much. please send to my email sinbearzc@hotmail.com if you can give me a help, thank..
sinbear wrote:
the hole...
What's a "hole?" Are you wanting to detect a space surrounded by
1
s?sinbear wrote:
two 1 which is quite far away from others...
What exactly does this mean?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
-
sinbear wrote:
the hole...
What's a "hole?" Are you wanting to detect a space surrounded by
1
s?sinbear wrote:
two 1 which is quite far away from others...
What exactly does this mean?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
-
1111-----1 1 11------ 1111----1- --------111 --------111 --------111 hi, as the previous question may not so easy to see, so i post the question out again here.. this is just only a example, and using C++ to solve plenty of these similiar example. In this problem, you can ignore all the - simbol as they stand for the space only, and you can see that: the hole formed inside many 1 consider call void element=V; here v = 1 two 1 which is quite far away from others is call exceptional element=E,here E = 2; let the total number of 1 =A; here A = 22 i need to use the C++ to calculate the below result S = (A-E)/(A+V) for example this case s = (22-2)/(21+1)=0.91 So how to write a C++ program, to search for the void element V; the exception element E as well as the total number of 1 A and calculate the result?? i am so eager to know the knowledge about this, may anyone give me a hand??? Your great help will be appreciated!!, thank so much. please send to my email sinbearzc@hotmail.com if you can give me a help, thank..
111100001 1 1100000 111100010 00000000111 00000000111 00000000111 ok, now i change the - to 0, to try to explain this example more clear, this file will be print out in txt format, require the c++ to read from the txt file and also, it is the birnary format, and now can see that the void V is the whole among the group of 1, 1111 1 11 1111 the two exceptional 1 E is locate at: 00001 00000 00010 which consider at not inside the group of 1 and like this 111 111 111 will consider as a group of 1 and so S = (A-E)/(A+V) is this help to explain the problem? thanks
-
111100001 1 1100000 111100010 00000000111 00000000111 00000000111 ok, now i change the - to 0, to try to explain this example more clear, this file will be print out in txt format, require the c++ to read from the txt file and also, it is the birnary format, and now can see that the void V is the whole among the group of 1, 1111 1 11 1111 the two exceptional 1 E is locate at: 00001 00000 00010 which consider at not inside the group of 1 and like this 111 111 111 will consider as a group of 1 and so S = (A-E)/(A+V) is this help to explain the problem? thanks
sinbear wrote:
the void V is the whole...
What value does this "hole" have? Given that, just search for this value and you've found the void. Or, if you say that the file is comprised of only
0
s and1
s, anything else would be considered a void. Correct?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
-
True. One is the loneliest number.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb