摘要:
头文件: #include <cstring> #include <sstream> 题目未给定数据个数,一般多在模拟题用到 string str; getchar(); //如果getline()之前已经读入过其他数据,需要用getchar()读掉前面剩下的回车 getline(cin, str) 阅读全文
摘要:
读取时间 HH:MM:SS:NN型 函数 //转为毫秒表示,方便比大小 int get(string time) { int h, m, s, ms; //从字符串内读数据 sscanf(time.c_str(), "%d:%d:%d.%d", &h, &m, &s, &ms); return h 阅读全文