Fancy Mouse
- -|||
摘要: 字符串处理。注意一下什么时候输出error什么时候对原字符串不进行修改 #includeusing namespace std;const int MAX = 40;void Delete(char s[],char a);void Insert(char s[],char a,char b);void Replace(char s[],char a,char b);int main(){ ... 阅读全文
posted @ 2005-08-27 13:25 Fancy Mouse 阅读(369) 评论(1) 推荐(0)
摘要: 直接做吧,没什么好说的了 #includeusing namespace std;int main(){ int n,i,j; while(cin>>n>>i>>j) { int c; //Line for(c=1;c1 && t2>1) t1--,t2--; while(t11) t1++,t2--; whi... 阅读全文
posted @ 2005-08-27 13:23 Fancy Mouse 阅读(269) 评论(1) 推荐(0)
摘要: 简单的格式处理。 #include#includeusing namespace std;int main(){ int a,b; while(cin>>a>>b) { cout 0) cout<<setw(6)<<b/10*a<<endl; cout<<"-------"<<endl; cout<<setw(7)<... 阅读全文
posted @ 2005-08-27 13:20 Fancy Mouse 阅读(293) 评论(1) 推荐(0)
摘要: 枚举搜索。当然用动态规划是最好的了。我的搜索办法是,先将所有石子放在一起,然后满堆和空堆的差就是石子总质量。接下来就一种状态一种状态搜索,每次搜索到把一个石子从原来那个堆移动到另一个堆以后,满堆和空堆的差就减去这个石子重量的2倍。搜索完毕,取最小的那个差值即可。 #includeusing namespace std;const int MAX = 20;void Stone(int curren... 阅读全文
posted @ 2005-08-27 13:19 Fancy Mouse 阅读(546) 评论(1) 推荐(0)