摘要: 题目大意:给若干个球队和比赛结果,按照给定的规则给球队排名。 多关键字域排序,题目不难,只是太繁琐,注意在按名字排名时是大小写不敏感的,在这里WA了一次... 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 struct Team 8 { 9 char name[35], tname[35]; 10 int point, game, win, tie, loss, diff, scored, against; 11 bool operator ... 阅读全文
posted @ 2013-08-30 21:26 xiaobaibuhei 阅读(347) 评论(0) 推荐(0)
摘要: 题目大意:给一个由字母构成的序列,输出按字典序的下一个排列。 用c++ STL的next_permutation可以很容易地解决。 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main() 7 { 8 #ifdef LOCAL 9 freopen("in", "r", stdin);10 #endif11 char str[60];12 while (gets(str) && str[0] != '#')13 {14 if (next_pe 阅读全文
posted @ 2013-08-30 19:35 xiaobaibuhei 阅读(192) 评论(0) 推荐(0)
摘要: 题目大意:大小端模式的转换。所谓的小端模式,是指数据的高位保存在内存的高地址中,而数据的低位保存在内存的低地址中。与此相对,所谓的大端模式,是指数据的高位,保存在内存的低地址中,而数据的低位,保存在内存的高地址中。以字节为单位,将整数的高低位进行交换即可,可以使用。 1 #include 2 #include 3 using namespace std; 4 5 int main() 6 { 7 #ifdef LOCAL 8 freopen("in", "r", stdin); 9 #endif10 int n;11 unsigned int un;12 阅读全文
posted @ 2013-08-30 19:13 xiaobaibuhei 阅读(389) 评论(0) 推荐(0)