#197 (div.2) A. Helpful Maths
来源:互联网 发布:数据库入门 编辑:程序博客网 时间:2024/06/05 15:02
1.题目描述:点击打开链接
2.解题思路:抽取出所有的数字,排序后输出即可。
3.代码:
#define _CRT_SECURE_NO_WARNINGS#include<iostream>#include<algorithm>#include<string>#include<sstream>#include<set>#include<vector>#include<stack>#include<map>#include<queue>#include<deque>#include<cstdlib>#include<cstdio>#include<cstring>#include<cmath>#include<ctime>#include<functional>using namespace std;#define me(s) memset(s,0,sizeof(s))typedef long long ll;typedef unsigned int uint;typedef unsigned long long ull;typedef pair <int, int> P;const int N=100;char s[N];int a[N];int main(){ while(~scanf("%s",s)) { me(a); int len=strlen(s); for(int i=0;i<len;i+=2) a[i/2]=s[i]-'0'; sort(a,a+len/2+1); for(int i=0;i<len/2+1;i++) printf("%d%c",a[i],"+\n"[i==len/2]); }}
0 0
- #197 (div.2) A. Helpful Maths
- Codeforces Round #197 (Div. 2) A. Helpful Maths
- Codeforces Round #197 (Div. 2)A. Helpful Maths
- A. Helpful Maths
- A. Helpful Maths
- 339A - Helpful Maths
- 【CodeForces】A. Helpful Maths
- CF197#DIV2:A-Helpful Maths
- CodeForces 339A Helpful Maths
- CodeForces-339A-Helpful Maths
- CF 339A Helpful Maths
- codeforces 339A Helpful Maths
- Problem--339A--Codeforces-- A. Helpful Maths
- Helpful Maths
- Helpful Maths
- Helpful Maths
- CodeForces 339 A.Helpful Maths(水~)
- codeforces 339A.Helpful Maths B.Xenia and Ringroad 两水题
- 【CSAPP】Shell Lab 外壳实验
- 玩转Andorid---组件篇---数据存储之preference
- 玩转Android---组件篇---数据存储之File
- QQuickImageProvider在QML设计中的应用
- 今天微软正式推出Windows 10
- #197 (div.2) A. Helpful Maths
- 游戏服务端架构发展史(上)
- 玩转Android---组件篇---数据存储之SQLite
- 九度oj 1207
- uvalive 3890
- 玩转Android---事件监听篇---第1篇
- 求.net后台程序员 http://jwstudio.cn?s=9uH (麻烦帮忙,广而告之,谢谢)
- presentationLayer
- shell脚本学习知识点(二)