Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8583421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:32:02+00:00 2026-06-11T21:32:02+00:00

I have possible inputs 1M 2M .. 11M and 1Y (M and Y stand

  • 0

I have possible inputs 1M 2M .. 11M and 1Y (M and Y stand for months ) and I want to output “somestring1 somestring2…. and somestring12” note M and Y are removed and the last string is changed to 12

    Example: input "11M" "hello" output: hello11
             input "1Y" "hello" output: hello1



char * (const char * date, const char * somestr)
{
    // just need to output final string no need to change the original string
    cout<< finalStr<<endl;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:32:04+00:00Added an answer on June 11, 2026 at 9:32 pm

    is this homework? If not, here’s what i’d suggest. (i ask about homework because you may have restrictions, not because we’re not here to help)

    1) do a find on ‘M’ in your string (using find), insert a ‘\0’ at that position if one is found (btw i’m assuming you have well formatted input)

    2) do a find on ‘Y’. if one is found, insert a ‘\0’ at that position. then do an atoi() or stringstream conversion on your string to convert to number. multiply by 12.

    3) concatenate your string representation of part 1 or part 2 to your somestr

    4) output.

    This can probably be done in < 10 lines if i could be bothered.
    the a.find(‘M’) part and its checks can be conditional operator, then the conversion/concatenation in two or three lines at most.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two possible widths for a string i want to display in a
Is it possible to have multiple inputs with multiple different mappers in Hadoop MapReduce?
I have a problem where I need to split an input string into possible
Possible Duplicate: JQuery datepicker- 2 inputs/textboxes and restricting range Hi i have two pickers
I have the following possible inputs: http://subdomain.domain.com/hello.html http://subdomain.domain.com https://subdomain.domain.com subdomain.domain.com http://domain.com/hello.html http://domain.com https://domain.com domain.com
Possible Duplicate: python dict.add_by_value(dict_2) ? My input is two dictionaries that have string keys
I have a class that wants to be initialized from a few possible inputs.
Is it possible to have two inputs, or button controls, trigger two different actions
I want to test all possible combinations of inputs to a verilog module. I
I have a form in which people will be entering dollar values. Possible inputs:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.