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 6735355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:59:57+00:00 2026-05-26T10:59:57+00:00

I have a script which takes a word from input file and outputs customizated

  • 0

I have a script which takes a word from input file and outputs customizated word in output file.

For example, in input file I have word ccccccaaaaaannnnndlllllleeeeeand I need to edit the word it to look like candle and output in other file. So could you please give me a example of it?

So far I have:

#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(){
    string vards;
    std::ifstream input_file("virkne3.in");
    input_file >> vards;
    std::ofstream output_file("virkne3.out");
    output_file << vards.erase(std::unique(vards.begin(), vards.end()), vards.end());
    cin.clear();
    cin.ignore(255, '\n');
    cin.get();
    return 0;
}
  • 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-05-26T10:59:57+00:00Added an answer on May 26, 2026 at 10:59 am

    Assuming you mean consecutive repeated letters, std::unique does exactly that.

    vards.erase(std::unique(vards.begin(), vards.end()), vards.end());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have PHP script which takes some file (FLV for example) and returns it
I have an SSIS script component which takes in rows from input. One of
I have a cgi script which takes form input, I want to facilitate the
I have a script which takes user input, the REFRESH option is optional. I
I have a powershell script below which takes a config file and deletes files
i have a script which takes data from a database and displays it on
I have a Perl script which nests foreach loops as seen below. It takes
I have a perl script, which takes a query string parameter, connects to a
i have a script which take hh:mm:ss inputs for example vid_cut.py -t 00:00:30 00:10:00
I need a PHP script which takes a URL of a web page and

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.