POPPUR爱换

 找回密码
 注册

QQ登录

只需一步,快速开始

手机号码,快捷登录

搜索
查看: 1323|回复: 2
打印 上一主题 下一主题

借人气请教两道C语言题目{请版主手下留情}

[复制链接]
跳转到指定楼层
1#
发表于 2007-2-5 01:25 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
朋友懒做作业,把两道C语言题目交给我,我又搞不懂...向各位大侠求救啦!

1.Tell me the frequencies
Given a line of text you will have to find out the frequencies of the ASCII
characters present in it. The given lines will contain none of the first 32
or last 128 ASCII characters. Of course lines may end with ‘n’ and ‘r’
but always keep those out of consideration.



Input

Several lines of text are given as input. Each line of text is considered as
a single input. Maximum length of each line is 1000.



Output

Print the ASCII value of the ASCII characters which are present and their
frequency according to the given format below. A blank line should separate
each set of output. Print the ASCII characters in the ascending order of
their frequencies. If two characters are present the same time print the
information of the ASCII character with higher ASCII value first. Input is
terminated by end of file.



Sample Input:

AAABBC
122333


Sample Output:

67 1
66 2
65 3

49 1
50 2
51 3


2.BACKGROUND
Most of the times, the students of Computer Science & Engineering of BUET
deal with bogus, tough and very complex formulae. That is why, sometimes,
even for a easy problem they think very hard and make the problem much
complex to solve. But, the team members of the team "BUET PESSIMISTIC"  are
the only exceptions. Just like the opposite manner, they treat every hard
problem as easy and so cannot do well in any contest. Today, they try to
solve a series but fail for treating it as hard. Let them help.


Input
Just try to determine the answer for the following series


You are given the value of N and A (integer, 1<=N<=13  &  integer, 0<=A<=15)
respectively.


Output
For each line of the input, your correct program should output the integer
value of the sum in separate lines for each pair of values of N & A.




Sample Input

3 3
4 4

Sample Output
102
1252
2#
发表于 2007-2-5 19:07 | 只看该作者
:sweatingbullets: 发现自己的E问水平是看不明白这个题目的:(
回复 支持 反对

使用道具 举报

3#
发表于 2007-2-5 21:24 | 只看该作者
发现自己的C语言已经忘记得差不多了.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

广告投放或合作|网站地图|处罚通告|

GMT+8, 2024-12-3 04:07

Powered by Discuz! X3.4

© 2001-2017 POPPUR.

快速回复 返回顶部 返回列表