Thread: Pairing letters

  1. #1
    Registered User
    Join Date
    Feb 2016
    Posts
    14

    Pairing letters

    Create
    a
    program
    that
    counts
    the
    number
    of
    pairs
    of
    succeeding
    letters
    in
    a
    given
    phrase.
    The
    program
    will
    stop
    when
    the
    enter
    key
    is
    hit.
    For
    example,
    the
    phrase
    “a
    bC_df
    g”
    has
    four
    such
    pairs:
    ab,
    bc,
    cd
    and
    fg.
    Note
    that
    characters
    aside
    from
    letters
    are
    disregarded
    and
    it
    also
    doesn’t
    matter
    whether
    the
    letter
    is
    in
    upper
    case
    or
    in
    lower
    case.

    We're only allowed to use basic functions. Arrays and pointers are not allowed. What do I do?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > What do I do?
    Well you could reformat your post so it isn't one word per line.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Sounds like you just need to count.

    You do not need any arrays, because you do not need to retain the input.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 09-11-2013, 11:12 PM
  2. Pairing Woes...
    By Vacuus in forum C++ Programming
    Replies: 3
    Last Post: 05-18-2007, 11:30 AM
  3. letters
    By CobraCC in forum C++ Programming
    Replies: 4
    Last Post: 05-01-2003, 08:47 AM
  4. The letters
    By drdodirty2002 in forum C Programming
    Replies: 4
    Last Post: 04-26-2003, 06:01 PM
  5. Asking for an int and I get letters
    By Um...well... in forum C++ Programming
    Replies: 2
    Last Post: 07-08-2002, 08:41 PM

Tags for this Thread