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();//忽视一行
时间: 2024-10-07 07:53:55
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();//忽视一行