摘要: #include <iostream>using namespace std;int n,m;int can;int jump(int position, int direction,int times ){if(times==2)can=0;if(can==1)return can;if(direction==1)position=position+times*2-1;if(direction==-1)position=position-times*2+1;if(position==m){can=1;return can;}if(position>0&&po 阅读全文
posted @ 2012-05-04 22:26 梨子 阅读(144) 评论(0) 推荐(0)
摘要: #include <iostream>#include <string>using namespace std;string a,b;int cacl(int n){ int i=n; int j=0; int all=0; while(i<a.length()) { while( j<b.length()) { if(a[i]==b[j]) { all++; j++; break; } j++; } if(j==b.length()) break; i++; } return all; }int main(vo... 阅读全文
posted @ 2012-05-04 10:05 梨子 阅读(112) 评论(0) 推荐(0)