Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to solve this problem(posted again)

how to solve this problem(posted again)

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestionc++com
8 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sinbear
    wrote on last edited by
    #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..

    C W D S 4 Replies Last reply
    0
    • S sinbear

      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..

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      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]

      1 Reply Last reply
      0
      • S sinbear

        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..

        W Offline
        W Offline
        Waldermort
        wrote on last edited by
        #3

        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 be 1-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.

        1 Reply Last reply
        0
        • S sinbear

          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..

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          sinbear wrote:

          the hole...

          What's a "hole?" Are you wanting to detect a space surrounded by 1s?

          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

          M 1 Reply Last reply
          0
          • D David Crow

            sinbear wrote:

            the hole...

            What's a "hole?" Are you wanting to detect a space surrounded by 1s?

            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

            M Offline
            M Offline
            Maximilien
            wrote on last edited by
            #5

            they must be very lonelly ones !!!


            Maximilien Lincourt Your Head A Splode - Strong Bad

            D 1 Reply Last reply
            0
            • S sinbear

              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..

              S Offline
              S Offline
              sinbear
              wrote on last edited by
              #6

              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

              D 1 Reply Last reply
              0
              • S sinbear

                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

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                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 0s and 1s, 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

                1 Reply Last reply
                0
                • M Maximilien

                  they must be very lonelly ones !!!


                  Maximilien Lincourt Your Head A Splode - Strong Bad

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  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

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups