• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ SS类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中SS的典型用法代码示例。如果您正苦于以下问题:C++ SS类的具体用法?C++ SS怎么用?C++ SS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了SS类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: split_textT

	SS split_textT(const typename SS::value_type& src,
					const typename SS::value_type& list,
					int limit = 0) noexcept
	{
		SS dst;
		bool tab_back = true;
		typename SS::value_type word;
		for(auto ch : src) {
			bool tab = false;
			if(limit <= 0 || static_cast<int>(dst.size()) < (limit - 1)) {
				if(string_strchr(list, ch)) {
					tab = true;
				}
			}
			if(tab_back && !tab && !word.empty()) {
				dst.push_back(word);
				word.clear();
			}
			if(!tab) word += ch;
			tab_back = tab;
		}
		if(!word.empty()) {
			dst.push_back(word);
		}
		return dst;
	}
开发者ID:hirakuni45,项目名称:R8C,代码行数:26,代码来源:string_utils.hpp


示例2: OnButtonOkClick

void FormSet::OnButtonOkClick()
{
	SS port = TextPort_.GetText();
	if (port.Length() == 0)
	{
		PopMessage(tcc_("请输入端口号"),800);
		TextPort_.SetFocus();
		return;
	}

	df::StringToInteger(port, G::main.listen_port);

	G::main.hide_window = choice_[0].GetCheck();

	TextPSW_.GetText(port);
	if (port.Length() > 0)
	{
		Sha2Password(port);
		G::main.access_psw = std::move(port);
	}
		

	G::WriteMainIni();
	Close();
}
开发者ID:rxaa,项目名称:SecuritySystem,代码行数:25,代码来源:FormSet.cpp


示例3: calc

void calc(SS& oprs, SD& nums, string& s) {
	string opr = oprs.top(); oprs.pop();
	if (opr[0] == 'u') s += opr[1];
	else s += opr;
	s += ' ';
	
	double b = nums.top(); nums.pop();
	if (opr[0] == 'u' || (is_func(opr) && opr != "pow")) {
			 if (opr == "u+") nums.push(b);
		else if (opr == "u-") nums.push(-b);

		else if (opr == "sin") nums.push(sin(b));
		else if (opr == "cos") nums.push(cos(b));
		else if (opr == "exp") nums.push(exp(b));
		else if (opr == "log") nums.push(log(b));
		else if (opr == "sqrt") nums.push(sqrt(b));
		else if (opr == "fabs") nums.push(fabs(b));
		return;
	}

	double a = nums.top(); nums.pop();
		 if (opr == "*") nums.push(a * b);
	else if (opr == "+") nums.push(a + b);
	else if (opr == "-") nums.push(a - b);
	else if (opr == "pow") nums.push(pow(a, b));
}
开发者ID:kevin1kevin1k,项目名称:dsa2015,代码行数:26,代码来源:3_4_2.cpp


示例4:

ostream& operator<<(ostream& out, const SS& s) {
	VS v;
	SS ss = s;
	while (!ss.empty()) {
		v.PB(ss.top());
		ss.pop();
	}
	for (int i = v.size() - 1; i >= 0; i--)
		out << v[i] << ' ';
	return out;
}
开发者ID:kevin1kevin1k,项目名称:dsa2015,代码行数:11,代码来源:3_4_2.cpp


示例5: add

int PermutationSum::add (int n) 
{
	SS ss;
	ss << n;
	ST st;
	st = ss.str();
	sort(all(st));
	cout << ss.str() << endl;
	int ret = 0;
	
	do {
		ret += atoi(st.c_str());
	} while(next_permutation(all(st)));
	
	return ret;
}
开发者ID:Jadnap,项目名称:My_TopCoder_Codes,代码行数:16,代码来源:PermutationSum.cpp


示例6: FindVerticalAxesDistance

int BackgroundPrinter::FindVerticalAxesDistance(wxDC *dc, std::vector<Draw*> draws, const SS& sd) {
	
	int d = 0;

	for (SS::const_iterator ssi = sd.begin(); ssi != sd.end(); ssi++) {
		set<int>::const_iterator si = (*ssi).begin();
		if ((*ssi).end() == si)
			assert(false);

		int di = *si;
		Draw *draw = draws[di];

		double max = draw->GetDrawInfo()->GetMax();
		double min = draw->GetDrawInfo()->GetMin();
		wxString maxs = draw->GetDrawInfo()->GetValueStr(max, _T(""));
		wxString mins = draw->GetDrawInfo()->GetValueStr(min, _T(""));

		wxString unit = draw->GetDrawInfo()->GetUnit();

		int maxext, minext, unitext, texth;
		dc->GetTextExtent(maxs, &maxext, &texth);
		dc->GetTextExtent(mins, &minext, &texth);
		dc->GetTextExtent(unit, &unitext, &texth);

		int msn = 0;
		do {
			int tw, th;
			dc->GetTextExtent(draws[*si]->GetDrawInfo()->GetUnit(), &tw, &th);
			msn = wxMax(msn, tw);
		} while (++si != (*ssi).end());
		

		int ext = wxMax(unitext, wxMax(maxext, minext));
		ext = wxMax(ext, msn) + line_width;

		d = wxMax(d, ext);

	} 

	return d;

}
开发者ID:,项目名称:,代码行数:42,代码来源:


示例7: main

int main() {
  String input;
  char c;

  while(std::cin >> input) {
    Stack s;
    SS ss;    
    
    unsigned int j = 0;
    while(j < input.size() && isprint(c = input[j++])) {
      if(c == '[') {
	unsigned int k = j;
	while(isNormalLetter(c = input[k]))
	  ++k;
	if(k == j)
	  continue;
	input[k] = '\0';
	s.push(String(&input[j]));
	input[k] = c;
	j = k;
      }
      else if(c == ']') {
        // nop
      }
      else {
	ss << c;
      }
    }

    // First print Stack, then SS.
    while(!s.empty()) {
      std::cout << s.top();
      s.pop();
    }
    std::cout << ss.str() << std::endl;
  }
}
开发者ID:LasseD,项目名称:uva,代码行数:37,代码来源:P11988.cpp


示例8: converter

template < class T > string converter( T n ){SS x;x << n;return x.str();} 
开发者ID:rve,项目名称:conf,代码行数:1,代码来源:t2.cpp


示例9: convtos

string convtos (T a)
{
    SS ss;
    ss << a;
    return ss.str();
}
开发者ID:DmitryPro,项目名称:code_antiplagiat,代码行数:6,代码来源:u8041_140_C_1006403.cpp


示例10: teams_template_struct

int teams_template_struct(void) {
  SS<int, 123, 456> V;
  return V.foo();

}
开发者ID:mathben,项目名称:clang,代码行数:5,代码来源:teams_codegen.cpp


示例11: play

void play(MSI& rank, VS& toks) {
	SS oprs;
	SD nums;
	string out = "";
	char str[100];

	cout << "# from infix to postfix!!!" << endl;
	
	for (VS::iterator i = toks.begin(); i != toks.end(); i++) {
		string tok = *i;
		
		cout << "There is a " << tok << ": ";

		if (is_num(tok)) {
			cout << "push to output" << endl;
			sprintf(str, "%.6lf ", stod(tok));
			out += str;
			nums.push(stod(tok));
		}
		else if (tok == ",") {
			cout << "flush the stack until '('" << endl;
			while (oprs.top() != "(")
				calc(oprs, nums, out);
		}
		else if (tok == ")") {
			cout << "flush the stack until '(' and check if there's a func" << endl;
			while (oprs.top() != "(")
				calc(oprs, nums, out);
			oprs.pop();
			if (!oprs.empty() && is_func(oprs.top()))
				calc(oprs, nums, out);
		}
		else {
			cout << "push to stack" << endl;
			if ( is_unary(tok) && (i == toks.begin() || rank[*(i - 1)] > 0) )
				oprs.push("u" + tok);
			else { 
				while (!is_func(tok) && tok != "(" && !oprs.empty() && rank[oprs.top()] <= rank[tok]) {
					cout << "\t*** stack.top() has higher precedence" << endl;
					calc(oprs, nums, out);
				}
				oprs.push(tok);
			}
		}

		cout << "\tcurrent output: " << out << endl
			 << "\tcurrent  stack: " << oprs << endl;
	}

	while (!oprs.empty())
		calc(oprs, nums, out);

	cout << "There is nothing left, so flush the stack to output" << endl
		 << "\tcurrent output: " << out << endl
		 << "#transformation completed!!!" << endl
		 << "Postfix Exp: " << out << endl
		 << "RESULT: " << nums.top() << endl << endl;
}
开发者ID:kevin1kevin1k,项目名称:dsa2015,代码行数:58,代码来源:3_4_2.cpp


示例12: GetDC

bool DrawsPrintout::OnPrintPage(int page) {
	if (page != 1)
		return false;
	int sel = 0;
	for (; sel < m_draws_count; ++sel) 
		if (m_draws[sel]->GetSelected())
			break;
	if (sel == m_draws_count)
		return false;
	wxDC *dc = GetDC();
#ifndef MINGW32
	try {
		wxPostScriptDC *psdc = dynamic_cast<wxPostScriptDC*>(dc);
		if (psdc != nullptr)
			psdc->PsPrint(_("\n/ISOLatin1Encoding [\n/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/minus/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde/.notdef/.notdef/Lslash/lslash/Nacute/nacute/aogonek/Cacute/cacute/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/dotlessi/grave/acute/Oacute/tilde/macron/breve/dotaccent/Eogonek/eogonek/Sacute/sacute/.notdef/hungarumlaut/ogonek/caron/space/exclamdown/cent/sterling/currency/yen/brokenbar/section/dieresis/copyright/ordfeminine/guillemotleft/logicalnot/hyphen/registered/macron/degree/plusminus/twosuperior/oacute/acute/mu/paragraph/periodcentered/.notdef/Zacute/zacute/.notdef/z/onehalf/threequarters/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/Ograve/Oacute/.notdef/.notdef/.notdef/multiply/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/oacute/.notdef/.notdef/.notdef/divide/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n] def\n"));
	} catch(...) { // tu ew. usuniecie polskich znakow
	}
#endif

	wxFont f;
#ifdef __WXMSW__ 
	f.Create(50, wxSWISS, wxNORMAL, wxNORMAL);
#else
	f.Create(8, wxSWISS, wxNORMAL, wxNORMAL);
#endif

	dc->SetMapMode(wxMM_TEXT);
	dc->SetFont(f);

	int ppiw, ppih;
	GetPPIPrinter(&ppiw, &ppih);
	//to milimiters
	ppiw /= 25;
	ppih /= 25;
	int lorigin = Print::page_setup_dialog_data->GetMarginTopLeft().x * ppiw;
	int torigin = Print::page_setup_dialog_data->GetMarginTopLeft().y * ppih;
	dc->SetDeviceOrigin(lorigin, torigin);

	int tw,th;
	dc->GetTextExtent(_T("Z"), &tw, &th);

	int topmargin, bottommargin, rightmargin;
	topmargin = 0;
	bottommargin = int(1.4 * th) + Print::page_setup_dialog_data->GetMarginBottomRight().y * ppih;
	rightmargin = 10 + Print::page_setup_dialog_data->GetMarginBottomRight().x * ppiw;
	SS cd = ChooseDraws();
	for (SS::iterator i = cd.begin(); i != cd.end(); i++) {
		int tm = (th + line_width) * (i->size() + 1);
		if (tm > topmargin)
			topmargin = tm;
	}
	int w, h, pw, ph;
	dc->GetSize(&w, &h);
	GetPageSizePixels(&pw, &ph);
	dc->SetUserScale((float)w / (float)pw, (float)h / (float)ph);

	BackgroundPrinter bp(0, rightmargin, topmargin, bottommargin);
	bp.SetFont(f);
	bp.SetSize(pw - print_left_margin - lorigin, (ph - print_top_margin - torigin) * 2 / 3);

	int graph_start = bp.PrintBackground(dc, m_draws, cd);
	bp.GetSize(&w, &h);
	GraphPrinter gp(
#ifdef __WXGTK__
			2, 
#else
			10, 
#endif
			graph_start, rightmargin, topmargin, bottommargin);
	gp.SetSize(w, h);
	gp.SetFont(f);

	gp.PrintDraws(dc, m_draws, m_draws_count);	
	PrintShortDrawNames(&gp, dc);
	PrintDrawsInfo(dc, lorigin, torigin, rightmargin, bottommargin);

	return true;
}
开发者ID:,项目名称:,代码行数:78,代码来源:


示例13: main

int main() {
	int m, n;
	int i, j, k;
	int max_subfile, max_file;
	string s, x;
	//freopen("f:\\in.txt", "r", stdin);
	while (cin >> s) {
		flist.clear();
		for (i=3; s[i]; ++i) {
			if (s[i] == '\\') flist.push_back(s.substr(0, i));
		}
		n = flist.size();
		for (i=0; i!=n; ++i) {
			if (fc.find(flist[i]) == fc.end()) {
				for (j=0; j!=i; ++j) {
					if (subfile.find(flist[j]) == subfile.end()) subfile.insert(make_pair(flist[j], 1));
					else ++subfile[flist[j]];
				}
				fc.insert(flist[i]);
			}
			if (file.find(flist[i]) == file.end()) file.insert(make_pair(flist[i], 1));
			else ++file[flist[i]];
		}
	}
	max_subfile = 0, max_file = 0;
	for (MSII it=subfile.begin(); it!=subfile.end(); ++it) max_subfile = max(max_subfile, it->second);
	for (MSII it=file.begin(); it!=file.end(); ++it) max_file = max(max_file, it->second);
	printf("%d %d\n", max_subfile, max_file);
	return 0;
}
开发者ID:delta4d,项目名称:AlgoSolution,代码行数:30,代码来源:C.cpp


示例14: main

int main(){
  string s1;
  int t,n,m,i,j;
  ios::sync_with_stdio(0);
  while(cin>>t){
    for(int ncase=1;ncase<=t;++ncase){
      cin>>n>>m;
      myset.clear();
      while(n--){
        cin>>s1;
        add(split(s1));
      }
      cnt=0;
      while(m--){
        cin>>s1;
        solve(split(s1));
      }
      printf("Case #%d: %d\n",ncase,cnt);
    }
  }
}
开发者ID:liusiyuxyfx,项目名称:obsolescenceL,代码行数:21,代码来源:FileFix-it.cpp


示例15: solve

void solve(SV v){
  for(int i=0;i<v.size();++i){
    if(!myset.count(v[i]))cnt++;
    myset.insert(v[i]);
  }
}
开发者ID:liusiyuxyfx,项目名称:obsolescenceL,代码行数:6,代码来源:FileFix-it.cpp


示例16: add

void add(SV v){
  for(int i=0;i<v.size();++i)
    myset.insert(v[i]);
}
开发者ID:liusiyuxyfx,项目名称:obsolescenceL,代码行数:4,代码来源:FileFix-it.cpp



注:本文中的SS类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ SSATmp类代码示例发布时间:2022-05-31
下一篇:
C++ SResources类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap