题目链接:http://www.codeforces.com/problemset/problem/339/A
题意:重新组合加法字符串,使得按照1,2,3的顺序进行排列。
C++代码:

#include <iostream>
#include <string>
using namespace std;
int cnt[];
string s, ans = "";
int main()
{
cin >> s;
int len = s.length();
for (int i = ; i < len; i += )
cnt[ s[i] - '' ] ++;
for (int i = ; i < ; i ++)
{
while (cnt[i] --)
{
char c = '' + i;
ans += "+";
ans += c;
}
}
cout << ans.substr();
return ;
}

C++

codeforces水题100道 第二十五题 Codeforces Round #197 A. Helpful Maths (Div. 2) (strings)的更多相关文章

  1. codeforces水题100道 第二十六题 Codeforces Beta Round #95 (Div. 2) A. cAPS lOCK (strings)

    题目链接:http://www.codeforces.com/problemset/problem/131/A题意:字符串大小写转换.C++代码: #include <cstdio> #i ...

  2. codeforces水题100道 第二十四题 Codeforces Beta Round #85 (Div. 2 Only) A. Petya and Strings (strings)

    题目链接:http://www.codeforces.com/problemset/problem/112/A题意:忽略大小写,比较两个字符串字典序大小.C++代码: #include <cst ...

  3. codeforces水题100道 第二十二题 Codeforces Beta Round #89 (Div. 2) A. String Task (strings)

    题目链接:http://www.codeforces.com/problemset/problem/118/A题意:字符串转换……C++代码: #include <string> #inc ...

  4. codeforces水题100道 第十五题 Codeforces Round #262 (Div. 2) A. Vasya and Socks (brute force)

    题目链接:http://www.codeforces.com/problemset/problem/460/A题意:Vasya每天用掉一双袜子,她妈妈每m天给他送一双袜子,Vasya一开始有n双袜子, ...

  5. codeforces水题100道 第二十题 Codeforces Round #191 (Div. 2) A. Flipping Game (brute force)

    题目链接:http://www.codeforces.com/problemset/problem/327/A题意:你现在有n张牌,这些派一面是0,另一面是1.编号从1到n,你需要翻转[i,j]区间的 ...

  6. codeforces水题100道 第十九题 Codeforces Round #109 (Div. 2) A. I_love_%username% (brute force)

    题目链接:http://www.codeforces.com/problemset/problem/155/A题意:找到当前最大值或者最小值出现的次数.“当前”的意思差不多是a[i]大于所有a[j]( ...

  7. codeforces水题100道 第十八题 Codeforces Round #289 (Div. 2, ACM ICPC Rules) A. Maximum in Table (brute force)

    题目链接:http://www.codeforces.com/problemset/problem/509/A题意:f[i][1]=f[1][i]=1,f[i][j]=f[i-1][j]+f[i][j ...

  8. codeforces水题100道 第十六题 Codeforces Round #164 (Div. 2) A. Games (brute force)

    题目链接:http://www.codeforces.com/problemset/problem/268/A题意:足球比赛中如果主场球队的主场球衣和客队的客队球衣颜色一样,那么要求主队穿上他们的可对 ...

  9. codeforces水题100道 第十四题 Codeforces Round #321 (Div. 2) A. Kefa and First Steps (brute force)

    题目链接:http://www.codeforces.com/problemset/problem/580/A题意:求最长连续非降子序列的长度.C++代码: #include <iostream ...

随机推荐

  1. Ogre 编辑器二(用Ogre的地形组件加载天龙八部地形)

    主界面如上文设计完成后,场景刚开始添加了是Ogre例子里的,发现场景里实物太少,于是想到直接把天龙的场景拿下来,天龙网上有源码,参考了下,把天龙的地形用Ogre的地形组件完成了下,如下是效果图: 因为 ...

  2. e828. 创建JTabbedPane

    A tabbed pane is a container that displays only one child component at a time. Typically, the childr ...

  3. poj1276

    题目链接:http://poj.org/problem? id=1276 Cash Machine Time Limit: 1000MS   Memory Limit: 10000K Total Su ...

  4. asp.net Core EF core ( Entity Framework 7 ) 数据库更新维护

    CreateData­baseIfNotExists等之前的API已经废弃,现在采用的是微软封装好,简化.高效的API,migrations 因为,旧API,要付出高昂的代价,以及局限性 打开VS20 ...

  5. [原创] MSP430G2系列图形化编程相关资料

    1.TI官方工具GRACE以及CCS介绍以及下载地址:http://www.ti.com.cn/tool/cn/grace 2.教程资料: ①手把手教你使用GRACE:   http://www.do ...

  6. Spring中初始化bean和销毁bean的时候执行某个方法的详解

    关于在spring  容器初始化 bean 和销毁前所做的操作定义方式有三种: 第一种:通过注解@PostConstruct  和 @PreDestroy 方法 实现初始化和销毁bean之前进行的操作 ...

  7. bioperl 自动化下载genbank 中的序列

    当我们想要从genbank 中下载序列的时候,总需要点击右上角的download 按钮,选择对应的格式,然后通过浏览器进行下载,这样反复的点击很费时间了 其实可以通过bioperl 自动化的完成下载: ...

  8. Spring cloud consul 相关前提知识

    Spring boot .vs.  Spring mvc  spring boot extends spring mvc extends spring Spring Boot uses Spring ...

  9. gradle 的安装

    前言: 我不是一个勤奋好学的人,奔着新技术就跑去尝试学习.但是在工作或者学习的过程中,遇到了的技术,还是得一个坎一个坎的迈过去.把今天遇到的坎变成明天的垫脚石. 想学习一下 spring 的源码,然后 ...

  10. C# Image与Base64编码互转函数

    public Bitmap GetImageFromBase64(string base64string) { byte[] b = Convert.FromBase64String(base64st ...