随笔分类 - c++
摘要:cin.getline(str a,int length) 可以读取一个小于等于的字符串【剩下的字符存储在缓冲区】 【这种方式也可以判断是否输入空字符串】 while(!(cin>>int)) {cin.clear()//清除错误 while(cin.get()!='\n') continue//清
阅读全文
摘要:1. 初始化 map<int,int> 变量名 map<int,int>stu 2. 遍历 可用迭代器遍历 还可以用 for(auto &a:stu) cout<<a.fitst(设立一个stu的迭代器a)
阅读全文
摘要:auto可以自动确认变量类型 , 在stl库中可以极大节省时间 如 auto pv = x.begin()
阅读全文

浙公网安备 33010602011771号