1.随机化的代码:
#include<cstdlib>
#include<ctime>
srand((unsigned)time(NULL));
m=rand()%(r-l+1)+l;
2.map<string,int>arr;//arr[key] = value
3.读入一整行字符串
getline(cin,s);
cin.ignore();//忽视一行
原文地址:http://www.cnblogs.com/MobileRobot/p/3719558.html