摘要: 结构体排序的几种情况1.一个结构体中有三个元素,按照其中一个元素进行降序排列:先定义一个结构体:struct node { int s; int t; int w;}a[1005];然后写排序代码:int cmp(node a, no... 阅读全文
posted @ 2017-09-25 18:18 moonlight987 阅读(696) 评论(0) 推荐(0) 编辑
摘要: 题意概括:有N个城市和M条道路,任意两个城市之间都有可能超过一种以上的可能。求任意两个城市之间的最短距离。解题思路:1:典型的多源最短路径问题。代码思路:1:用一个二维数组e来存储任意两个城市之间的距离,用inf = 99999999来初始化存储除一个... 阅读全文
posted @ 2017-09-21 22:38 moonlight987 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Description 求A^B的最后三位数表示的整数(1#includeint main(void){ int n; int a, b, i, m, T; scanf("%d", &T); while(T--) { ... 阅读全文
posted @ 2017-09-19 23:52 moonlight987 阅读(218) 评论(0) 推荐(0) 编辑
摘要: /* 原作者: glq2000 /* 参考资料: http://www.matrix67.com/blog/archives/115 */ #include #include char a[] = "ab... 阅读全文
posted @ 2017-09-19 22:36 moonlight987 阅读(87) 评论(0) 推荐(0) 编辑