• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
youdiankun
博客园    首页    新随笔    联系   管理    订阅  订阅
2013年9月4日
UVA10815 - 详解Andy's First Dictionary
摘要: Andy's First DictionaryAndy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task for him, as the number of words that he knows is, well, not quite enough. Instead of thinking up all the words himself, he has a briliant idea. From his bookshelf he would pick one 阅读全文
posted @ 2013-09-04 21:43 youdiankun 阅读(334) 评论(0) 推荐(0)
c语言中的qsort函数(转)
摘要: 做题时自己也不是很清楚,转来别人的学习一下。一、对int类型数组排序 int num[100]; int cmp ( const void *a , const void *b ) { return *(int *)a - *(int *)b; } 可见:参数列表是两个空指针,现在他要去指向你的数组元素。所以转型为你当前的类型,然后取值。升序排列。 因为是按照acsll码的值进行的,所以在前面的字符的值一定小于后面的字符。 那么,对于a b,如果a的值>b的值,就说明在字母表中a在b的后面,返回值为1表示ture,执行交换。 qsort(num,100,sizeof(nu... 阅读全文
posted @ 2013-09-04 17:53 youdiankun 阅读(364) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3