蔡諝的窝

博客园 首页 新随笔 联系 订阅 管理

2011年3月28日 #

摘要: 贴代码:#include <iostream>#include<string>using namespace std;void main(){ string str; cin>>str; if(str.compare("hello")==0)cout<<"succ"<<endl; else cout<<"wrong"<<endl;}体会:网上搜索下,也许你都会知道一个函数strcmp,也许你正尝试着调试这个函数,但不幸的是这个函数的两个参数都必须是co 阅读全文
posted @ 2011-03-28 17:28 蔡諝 阅读(37026) 评论(0) 推荐(0)

摘要: 贴出错误代码:#include <iostream>#include <string>using namespace std;void main(){ string str; cin>>str; switch(str) { case "ab": cout<<"one"<<endl; break; case "cd": cout<<"two"<<endl; break; default: cout<<"error 阅读全文
posted @ 2011-03-28 16:33 蔡諝 阅读(8442) 评论(0) 推荐(0)