编程介的小学生 2019-08-04 22:00 采纳率: 20.5%
浏览 169

用程序来输出歇后语的代码编写,C语言

Problem Description
Garfield enjoys learns idioms very much. There is an interesting kind of idiom of chinese, and we call it ”歇后语". Garfield has a list of this idioms, but the format is awful. Garfield is not very smart, you should use the program to help him to tidy up the idioms.
The standard formt of an idiom here is “A——B”, for example, “王婆卖瓜——自卖自夸". But now there are three awful situations you need to deal with:
1)sometimes there is a pair of chinese brackets in the expression to explain something, and you need to omit the brackets and contexts between them. For example, “麦场上挂马灯——照常(场)".

2)sometimes there are several Bs for the unique A, and two Bs are separated by chinese semicolons. You need to slip the idiom, for each B. For example, “麻布手中绣牡丹——配不上;不配".

3)sometimes the dash between A and B is took place by chinese comma, and you need to change them into dash. For example, “泥菩萨过河,自身难保".

But sometimes both the dash and the comma exit in the idiom, then we define it that the dash is just the separator for A and B.

Input
There is a integer N(1<N<10000) indicating the number of the list to deal. Then N lines follows, each line contain an idiom, and the length of every idiom isn’t beyond 200.

Output
Int first line, output the number of the list you get. Then put the result you calculate. You should sort the list according to the length of idioms, then the lexicographical places.

Hint
中间用到的标点符号,可以在题目中或者输入数据中复制

Sample Input
4
王婆卖瓜——自卖自夸
麦场上挂马灯——照常(场)
麻布手中绣牡丹——配不上;不配
泥菩萨过河,自身难保

Sample Output
5
麦场上挂马灯——照常
王婆卖瓜——自卖自夸
麻布手中绣牡丹——不配
泥菩萨过河——自身难保
麻布手中绣牡丹——配不上

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 求一个html代码,有偿
    • ¥100 关于使用MATLAB中copularnd函数的问题
    • ¥20 在虚拟机的pycharm上
    • ¥15 jupyterthemes 设置完毕后没有效果
    • ¥15 matlab图像高斯低通滤波
    • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
    • ¥15 钢筋实图交点识别,机器视觉代码
    • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
    • ¥50 400g qsfp 光模块iphy方案
    • ¥15 两块ADC0804用proteus仿真时,出现异常