2016年1月10日

百钱百鸡

摘要: 1只公鸡值5文钱;1只母鸡值3文钱;3只小鸡值1文钱。请问用文钱买100只鸡,公鸡、母鸡和小鸡各有几只?实际题目中会按照M文钱买N只鸡的形式按公鸡母鸡小鸡的顺序分别输出结果,一组解答占一行,解答按照公鸡数目从大到小排序(其次母鸡,再次小鸡)无解时请输出 no answer如输入为:100 100则输... 阅读全文
posted @ 2016-01-10 18:41 _阿赞 阅读(308) 评论(0) 推荐(0) 编辑

Delete characters

摘要: DescriptionIn this exercise, you will get two strings A and B in each test group and the length of every string is less than 40, you need to delete al... 阅读全文
posted @ 2016-01-10 17:45 _阿赞 阅读(327) 评论(0) 推荐(0) 编辑

c语言中gets ,getschar 和fgets 的用法及三者之间的差别,还有scanf

摘要: ①gets——从标准输入接收一串字符,遇到'\n'时结束,但不接收'\n',把 '\n'留存输入缓冲区;把接收的一串字符存储在形式参数指针指向的空间,并在最后自动添加一个'\0'。getchar——从标准输入接收一个字符返回,多余的字符全部留在输入缓冲区。fgets——从文件或标准输入接收一串字符,... 阅读全文
posted @ 2016-01-10 16:24 _阿赞 阅读(5312) 评论(0) 推荐(1) 编辑