当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2700:Parity

题目描述
A bit string has odd parity if the number of 1's is odd. A bit string has even parity if the number of 1's is even.Zero is considered to be an even number, so a bit string with no 1's has even parity. Note that the number of
0's does not affect the parity of a bit string.
输入解释
The input consists of one or more strings, each on a line by itself, followed by a line containing only "#" that signals the end of the input. Each string contains 1–31 bits followed by either a lowercase letter 'e' or a lowercase letter 'o'.
输出解释
Each line of output must look just like the corresponding line of input, except that the letter at the end is replaced by the correct bit so that the entire bit string has even parity (if the letter was 'e') or odd parity (if the letter was 'o').
输入样例
101e
010010o
1e
000e
110100101o
#
输出样例
1010
0100101
11
0000
1101001010
来自杭电HDUOJ的附加信息
Recommend zty

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 2008 Mid-Central USA

源链接: HDU-2700

最后修改于 2020-10-25T22:56:03+00:00 由爬虫自动更新

共提交 44

通过率 79.55%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)