桑海

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2013年2月24日

摘要: 2000:ASCII码排序View Code 1 #include<iostream> 2 #include<iomanip> 3 using namespace std; 4 5 const double PI = 3.1415927; 6 int main() 7 { 8 double r; 9 while(cin >> r)10 {11 cout.precision(3);12 cout.setf(ios::fixed);13 cout << 4*PI*r*r*r/3 << endl;14 }15 return 0;16... 阅读全文
posted @ 2013-02-24 20:31 桑海 阅读(280) 评论(0) 推荐(0) 编辑

摘要: Problem DescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean.The warehouse has N rooms. The i-th room contains J[i] pounds of JavaBeans and requires F[i] pounds of cat food. FatMouse does not have to trade for a 阅读全文
posted @ 2013-02-24 15:05 桑海 阅读(326) 评论(0) 推荐(0) 编辑

摘要: 转自:VincentCZW1.qsort函数:原型:void qsort(void *base, int nelem, int width, int (*fcmp)(const void *,const void *));功能:使用快速排序例程进行排序参 数:1 待排序数组首地址2 数组中待排序元素数量3 各元素的占用空间大小4 指向函数的指针,用于确定排序的顺序说明:qsort函数是ANSI C标准中提供的,其声明在stdlib.h文件中,是根据二分法写的,其时间复杂度为n*log(n)。qsort要求提供的函数是需要自己定义的一个比较函数,比较函数使得qsort通用性更好。有了比较函数qs 阅读全文
posted @ 2013-02-24 14:53 桑海 阅读(241) 评论(0) 推荐(0) 编辑