摘要: http://pat.zju.edu.cn/contests/pat-practise/1032好吧,注意有可能存在空串,别的就没什么了,代码写的比较烂,有好多不必要的重复。 1 #include <stdio.h> 2 struct Node{ 3 int next_num; 4 char ch; 5 }; 6 7 struct Node nodes[100002]; 8 int main() 9 {10 int head1,head2,node_num;11 scanf("%d%d%d",&head1,&head2,&node_num 阅读全文
posted @ 2012-06-12 18:58 linyvxiang 阅读(389) 评论(0) 推荐(0) 编辑
摘要: http://pat.zju.edu.cn/contests/pat-practise/1031模拟题 1 #include <stdio.h> 2 #include <string.h> 3 char words[100]; 4 int main() 5 { 6 scanf("%s",words); 7 //先确定底部的长度 8 int i; 9 int n2;10 for(i=3;;i++) {11 if((strlen(words)-i)%2==0&&((strlen(words)-i)/2+1<=i)){12 ... 阅读全文
posted @ 2012-06-12 17:01 linyvxiang 阅读(225) 评论(0) 推荐(0) 编辑
摘要: http://pat.zju.edu.cn/contests/pat-practise/1024简单大数 1 #include <stdio.h> 2 #include <string.h> 3 char ori_str[100],trans_str[100]; 4 char temp[100]; 5 int K; 6 7 void trans(char *str) 8 { 9 int i=strlen(str);10 11 int j;12 for(j=0;j<i;j++) {13 trans_str[j]=ori_str[i-1-j];14 ... 阅读全文
posted @ 2012-06-12 16:17 linyvxiang 阅读(282) 评论(0) 推荐(0) 编辑