关于一些初级ACM竞赛题目的分析和题解(二)。

今天写了关于排序的题  中间有加号的复杂的一行字符   其次还有关于tolower函数的应用, 上题                                                                                                                                       
A. Helpful Maths
time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

Xenia the beginner mathematician is a third year student at elementary school. She is now learning the addition operation.

The teacher has written down the sum of multiple numbers. Pupils should calculate the sum. To make the calculation easier, the sum only contains numbers 1, 2 and 3. Still, that isn't enough for Xenia. She is only beginning to count, so she can calculate a sum only if the summands follow in non-decreasing order. For example, she can't calculate sum 1+3+2+1 but she can calculate sums 1+1+2 and 3+3.

You've got the sum that was written on the board. Rearrange the summans and print the sum in such a way that Xenia can calculate the sum.

Input

The first line contains a non-empty string s — the sum Xenia needs to count. String s contains no spaces. It only contains digits and characters "+". Besides, string s is a correct sum of numbers 1, 2 and 3. String s is at most 100 characters long.

Output

Print the new sum that Xenia can count.

Examples
input
3+2+1

output
1+2+3

input
1+1+3+1+3

output
1+1+1+3+3

input
2

output
2

简单的排序题s<=100,加号不变数字升序排好,下面是代码,用冒泡排序法排列:

#include<cstdio>char s[200];//   定义字符串;int main()
{
int i,j;
scanf("%s",s);//    输入字符串
for(i=0;s[i];i+=2)//  开始冒泡排序for(j=i;s[j];j+=2)if(s[i]>s[j])s[i]^=s[j]^=s[i]^=s[j];//   升序排序
puts(s);//  输出字符串
}
A. String Task
time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

Petya started to attend programming lessons. On the first lesson his task was to write a simple program. The program was supposed to do the following: in the given string, consisting if uppercase and lowercase Latin letters, it:

  • deletes all the vowels,
  • inserts a character "." before each consonant,
  • replaces all uppercase consonants with corresponding lowercase ones.

Vowels are letters "A", "O", "Y", "E", "U", "I", and the rest are consonants. The program's input is exactly one string, it should return the output as a single string, resulting after the program's processing the initial string.

Help Petya cope with this easy task.

Input

The first line represents input string of Petya's program. This string only consists of uppercase and lowercase Latin letters and its length is from 1 to 100, inclusive.

Output

Print the resulting string. It is guaranteed that this string is not empty.

Examples
input
tour

output
.t.r

input
Codeforces

output
.c.d.f.r.c.s

input
aBAcAba

output
.b.c.b

输入小于100个字母(不分大小写),含aeiouy(含大写)的字母去掉,其他字母输出时在前面加个.,下面为代码:

#import<bits/stdc++.h>
main(char s)
{
while(std::cin>>s)//  输入字符串
if(!strchr("AEIOUYaeiouy",s))
cout<<'.'<<(char)tolower(s);  //tolower 函数 把ascii码转换为字符
}

关于一些初级ACM竞赛题目的分析和题解(二)。相关推荐

  1. 关于一些初级ACM竞赛题目的分析和题解(十)

    关于一些初级ACM竞赛题目的分析和题解(十) 西面的题目是关于一些字母变换的,上题: A. Word time limit per test 2 seconds memory limit per te ...

  2. 关于一些初级ACM竞赛题目的分析和题解(六)。

    关于一些初级ACM竞赛题目的分析和题解(六). 下面是关于一些关于数字判断的题,比较简单,先来看第一题: A. Lucky Division time limit per test 2 seconds ...

  3. 《算法竞赛中的初等数论》(六)正文 0x60 原根(ACM / OI / MO)(二十万字符数论书)

    整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 写在最前面:本文部分内容来自网上各大博客或是各类图书,由我个人整理,增加些许见解,仅做学习交流使用,无 ...

  4. 2019浙江ACM省赛部分题解-ABDEFGHIJK

    太菜了,心态炸了.QAQ A-Vertices in the Pocket() 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?proble ...

  5. 华东交通大学2018年ACM双基程序设计大赛题解

    华东交通大学2018年ACM"双基"程序设计竞赛 代码头多的都是标答Ctrl+c下来的,给自己挖个坟,回头有时间再填回去,不填回去就死在这里吧-- 传送门:https://ac.n ...

  6. ACM新生赛部分题解

    2021级的ACM新生赛已经完结了,我就自己做出来的八道题整理一下题解,因为其他是真的不会. 链接:登录-专业IT笔试面试备考平台_牛客网 来源:牛客网 一.我们是冠军 7 日星期 777 的凌晨,7 ...

  7. 2021暨南大学轩辕杯ACM程序设计新生赛题解

    title : 2021暨南大学轩辕杯ACM程序设计新生赛 date : 2021-12-12 tags : ACM,练习记录 author : Linno 题目链接:https://ac.nowco ...

  8. 2018年第十届ACM四川省省赛题解(10 / 11)

    整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 2018ACM四川省省赛 题目链接:https://www.oj.swust.edu.cn/probl ...

  9. 华东交通大学2017年ACM双基程序设计大赛题解

    简单题 Time Limit : 3000/1000ms (Java/Other)   Memory Limit : 65535/32768K (Java/Other) Total Submissio ...

最新文章

  1. Django+Bootstrap+Mysql 搭建个人博客(五)
  2. 清华滴滴:出行数据透视中国城市空间发展报告!
  3. WindowsServer和普通WIN操作系统有什么不同?
  4. 把struts2的struts.xml配置文件分解成多个配置文件
  5. 02-继承的本质-Objective-C基础
  6. 判断整数序列是不是二元查找树的后序遍历结果
  7. 《播客》项目总结——web标准页面设计方面(转)
  8. 思科室外AP无法注册到WLC
  9. 推荐几个更新比我勤快的优质产品号
  10. 史上最全!!收藏了!3D建模软件大全
  11. CRM客户管理系统的功能模块有哪些
  12. 通信原理及系统系列19—— 锁相环(鉴相器分析_2)
  13. python批量生成经纬度坐标查询_用Python评测三种批量查询经纬度的方法,你pick哪一种?...
  14. Rstudio与R的绑定和更新
  15. 6G需要1000亿个基站;5G套餐资费年内或降至50至60元;国内首款L4级5G无人驾驶汽车量产...
  16. mac php怎么做网页,Mac_mac系统中safari怎么添加书签? 把常用网页添加到收藏夹的效果,苹果电脑mac系统自带safari浏览 - phpStudy...
  17. golang 常量 iota
  18. imx8mq-evk快速启动-方案讨论,准备工作
  19. 法律法规与标准化知识
  20. 宗镜录略讲——南怀瑾老师——系列4

热门文章

  1. 64位Win10下python调用dll出错
  2. java基础复习看这篇就够了
  3. CSDN下载资源再评论不返积分2017-11-8 11:00
  4. Mac冒险游戏---巨人约顿for Mac
  5. 取消html的a的变颜色属性,H5中取消a标签在点击时的背景颜色的方法
  6. MSP432单片机学习记录(二)
  7. Spring Coud 2.0 Client 使用 https 注册到 eureka server 中 (二)
  8. Conditional Structure Generation throughGraph Variational Generative Adversarial Nets 论文阅读
  9. 大整数加法(c++)
  10. 常用的GitHub的搜索筛选条件