原题地址:http://codeforces.com/gym/100286/attachments/download/2013/20082009-acmicpc-northeastern-european-regional-contest-neerc-08-en.pdf

题意大概就是让你把写在一块的变量分开。。水题,用string过。

详见代码:

//#include<iostream>
#include<fstream>
#include<string>
#include<algorithm>
using namespace std;string s;
string allType;
string va,ty;
string Analyze(string v) {int t = 0;while ((v[t] >= 'A' && v[t] <= 'Z') || (v[t] >= 'a' && v[t] <= 'z'))t++;va.assign(v.begin(), v.begin() + t);ty.assign(v.begin() + t, v.end());reverse(ty.begin(), ty.end());return ty + " " + va + ";";
}string a;int main() {ifstream cin("isharp.in");ofstream cout("isharp.out");cin.sync_with_stdio(false);getline(cin, s);int tmp = 0;while (s[tmp] != ' ')tmp++;allType.assign(s.begin(), s.begin() + tmp);tmp++;while (true) {int t = tmp;while (s[t] != ',' && s[t] != ';')t++;a.assign(s.begin() + tmp, s.begin() + t);a = allType + Analyze(a);int c = 0;for (int i = 0; i < a.length(); i++) {if (a[i] == '[' || a[i] == ']') {c++;if (c % 2)cout << '[';else cout << ']';}else cout << a[i];}cout << endl;if (s[t] == ';')break;tmp = t + 2;}return 0;
}

转载于:https://www.cnblogs.com/HarryGuo2012/p/4713933.html

Codeforces Gym 100286I iSharp 模拟相关推荐

  1. Codeforces Gym 100286I iSharp 水题

    Problem I. iSharp Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest ...

  2. Codeforces Gym 101173 CERC 16 D BZOJ 4790 Dancing Disks

    Codeforces Gym 101173 CERC 16 D & BZOJ 4790 Dancing Disks 强烈安利这道构造题目,非常有意思. 这里用到的思想是归并排序! 多路归并排序 ...

  3. Codeforces Gym 101086 M ACPC Headquarters : AASTMT (Stairway to Heaven)

    Codeforces Gym 101086 M ACPC Headquarters : AASTMT (Stairway to Heaven) 题目来源: Codeforces 题意: 给出一些比赛, ...

  4. [Codeforces Gym 101651/100725B] Banal Tickets

    Codeforces Gym 100725 题解: 先分两种情况, 积为000与积非0" role="presentation" style="position ...

  5. Codeforces Gym 101158 E. Infallibly Crack Perplexing Cryptarithm (模拟 + 语法分析)

    AC代码 C++版本 /* 根据 定义的等式 的规则 判断给定串可以写成多少种二进制等式且成立的形式解法: 通过语法分析的形式将多个表达式定义进行 递归下降的解析. 此方法可以不用过多考虑多种表达式定 ...

  6. Codeforces Gym 2015 ACM Arabella Collegiate Programming Contest

    比赛链接: http://codeforces.com/gym/100676 题目链接: http://codeforces.com/gym/100676/attachments/download/3 ...

  7. Codeforces Gym 100513G G. FacePalm Accounting 暴力

    G. FacePalm Accounting Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100513 ...

  8. Codeforces Gym 100269 Dwarf Tower (最短路)

    题目连接: http://codeforces.com/gym/100269/attachments Description Little Vasya is playing a new game na ...

  9. Codeforces Gym 100676G Training Camp 状压dp

    http://codeforces.com/gym/100676 题目大意是告诉你要修n门课,每门课有一个权值w[i], 在第k天修该课程讲获得k*w[i]的学习点数,给出了课程与先修课程的关系,要修 ...

最新文章

  1. 大学老师吐血自白:指导学生写论文真是太太太太太难了!
  2. unix环境高级编程-线程(2)
  3. 机器学习 不均衡数据的处理方法
  4. 暗通道先验去雾实现过程分析
  5. 200行代码写一个简易的dva
  6. linux创建脚本文件auto,linux 自动化部署脚本
  7. Github图片无法打开的问题解决【2020.07.20更新】
  8. govendor用法
  9. 的优先级大小_cache也有优先级
  10. python3标识符_python3学习笔记一(标识符、关键字)
  11. 普中28335开发攻略_TMS320F28335项目开发记录5_28335之CCS编程基础
  12. 二等分计算机打印机尺寸,电脑打印纸三种等分是什么尺寸
  13. mysql cmd 关闭防火墙_MySQL WorkBench:Failed to Connect to MySQL at XXX.XXX.XXX with user XXX
  14. 目标跟踪技术及其数据集
  15. 数论复习之费马与欧拉
  16. 【四】头歌平台实验-确定性推理
  17. 软件测试原书第二版(佩腾著)-学习笔记(一)
  18. qt 设置背景图片、背景色步骤
  19. 关于代码审查的一些探讨和总结
  20. 中国剩余定理扩展中国剩余定理 入门详解

热门文章

  1. python批量读取用例的方法
  2. java xml读取方法_Java读取XML文件的方法
  3. 使用Maven的jaxws-maven-plugin插件,将wsdl生成java
  4. 将excel里面的数据直接生成sql语句
  5. Linux学习笔记:Linux常用命令操作
  6. 《天天数学》连载05:一月五日
  7. 【codevs2492】【Tyvj1941】上帝造题的七分钟2,线段树的特别技巧
  8. 【BZOJ4514】数字配对,费用流
  9. 【BZOJ2330】【tyvj1785】【codevs2404】糖果,第一次的差分约束
  10. 1.极限——例子_3