摘要:
int main (int argc, char* argv[]){std::ios::sync_with_stdio (false); stringfirstName, lastName; multimap>kidsNames; while (cin>> firstName >> lastN... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(200)
评论(0)
推荐(0)
摘要:
int main (int argc, char* argv[]){std::ios::sync_with_stdio (false); //忽略列表 setexclude ={ "fuck", "damn" }; stringword; map word_count; while (cin>... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(206)
评论(0)
推荐(0)
摘要:
int main (int argc, char* argv[]){std::ios::sync_with_stdio (false);//将范围从v.begin()到v.end()的元素copy到c的end()处 copy(v.begin (), v.end (), inserter (c, c.... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(360)
评论(0)
推荐(0)
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Csharp{ classProgram {static ... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(216)
评论(0)
推荐(0)
摘要:
引用地址: http://blog.csdn.net/caroline_wendy题目: 写一个函数,求两个整数之和, 要求在函数体内不得使用+, -, *, /四则运算符号.不能使用运算符号,使用位运算,第一步异或运算选位,第二步与运算进位.代码:[cpp] view plaincopy#incl... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(109)
评论(0)
推荐(0)
摘要:
int main (int argc, char *argv[]){ string file= argv[1] ; cout> word)out << word << " "; ifstream in(file); if(!in.is_open ()) {cout << "Cannot ope... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(110)
评论(0)
推荐(0)
摘要:
一个很重要的想法来自http://zhex.iteye.com/blog/492722提到的:3. 两个三位数的乘积肯定是一个六位数, 而这个六位回文数数P我们可以用xyzzyx的形式表示,那我们可以得到下面的公式:P = 100000x + 10000y + 1000z + 100z + 1... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(157)
评论(0)
推荐(0)
摘要:
int main(int argc, char **argv){ int i; cout>i; autoif_equal_zero = [&]()-> bool{if (i == 0)return true;elsewhile (i > 0)--i;return false; }; cout ... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(156)
评论(0)
推荐(0)
摘要:
#include >#include >#include >#include >using namespace std;string make_plural(size_t ctr, const string &word, const string&ending){ return (ct... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(164)
评论(0)
推荐(0)
摘要:
include include include int main(int argc, char **argv){int a = 0, b = 0, c = 0;string str;getline(cin, str);for(auto it = str.begin(); it != str.e... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(290)
评论(0)
推荐(0)
摘要:
class circle{int a; // 普通变量,不能在类中初始化static int b; // 静态变量,不能在类中初始化static const int c=2; // 静态常量,可以在类中初始化static const double PI=3.1416;//error C2864... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(300)
评论(0)
推荐(0)
摘要:
原文地址:博客中尖括号不显示的问题作者:木子超-同学 今天突然发现以前博文中粘贴的代码都有了问题,C++代码中头文件“#include……”后面的的部分都不见了,单单显示为“#include”,颇感纠结,百度了一下才发现原来是HTML和XML转义字符的问题。大概意思就是说尖括号为HTML和XM... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(313)
评论(0)
推荐(0)
摘要:
int main (int argc, char* argv[]){std::ios::sync_with_stdio (false); vector fuck{ "fuck", "fuck", "fuck", "fuck", "fuck", "fuck","fuck", "fuck", "f... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(120)
评论(0)
推荐(0)
摘要:
int main (int argc, char* argv[]){std::ios::sync_with_stdio (false); ifstreamfile; file.open(argv[1]); mapword_count; string word,line; while(getline ... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(220)
评论(0)
推荐(0)
摘要:
list& DeleteRepeatElements (list&lst){ lst.sort(); lst.unique(); for (conststring &each_word : lst)cout << each_word << " "; cout<< endl; returnlst... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(115)
评论(0)
推荐(0)
摘要:
题目:假设你有一个数组,其中的第 i 个元素代表给定的第 i 天的股票价格。如果你被允许至多完成一个交易(如,买一和卖一股票),设计一个算法找出最大的利润。解决思路:首先赋首元素的值给最小,依次向后计算利润,每次与最大值比较并保存新的最大值和新的最小值。int MaxProfit (vecto... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(172)
评论(0)
推荐(0)
摘要:
int main (int argc, char* argv[]){vectornumbers; cout numbers.begin ();)cout << *--it << " "; cout<< endl; return0;} 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(491)
评论(0)
推荐(0)
摘要:
#include#define ARR_SIZE(a)(sizeof((a)) / sizeof((a[0])))int a[] = {1, 23, 32, 0, 2, 5, 23};void insert_sort(int *a, int n) { int i, j,temp; for (i... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(128)
评论(0)
推荐(0)
摘要:
题目:约瑟夫环约瑟夫环是一个数学的应用问题:已知n个人(以编号1,2,3...n分别表示)围坐在一张圆桌周围。从编号为k的人开始报数,数到m的那个人出列;他的下一个人又从1开始报数,数到m的那个人又出列;依此规律重复下去,直到圆桌周围的人全部出列。int Josephus (int sum, ... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(127)
评论(0)
推荐(0)
摘要:
int main (){ cout<< "Please input some numbers:" << endl;//定义输入流迭代器和尾后迭代器istream_iterator input_number_it (cin),eof;//用迭代器与尾后迭代器初始化vectorvectornumb... 阅读全文
posted @ 2014-07-18 21:07
wu_overflow
阅读(125)
评论(0)
推荐(0)
摘要:
铅(なまり)の空(そら)【阴霾的天空】重(おも)く垂(た)れ込(こ)み【垂下凝重的幕帘】真白(ましろ)に淀(よど)んだ【沉入苍白之中】太阳(たいよう)が砕(くだ)けて【将太阳斩碎】耳鸣(みみな)りを尖(とが)らせる【让我大声尖叫】ひゅるりひゅるり【迅速地 迅速地】低(ひく)いツバメ(つばめ)が... 阅读全文
posted @ 2014-07-18 21:06
wu_overflow
阅读(113)
评论(0)
推荐(0)
摘要:
#include #include using namespace std;//以下任意一种定义方式均合法//using funcp = int(*) (int, int);//typedef int(*funcp) (int, int);//若已知目标类型为Func, 则可以//int Fu... 阅读全文
posted @ 2014-07-18 21:06
wu_overflow
阅读(400)
评论(0)
推荐(0)
摘要:
int array[10];int (*func(int i))[10];using arrInt = int[10];arrInt *func2(int i);typedef int arrayInt[10];arrayInt *func3(int i);auto func4 (int i)... 阅读全文
posted @ 2014-07-18 21:06
wu_overflow
阅读(186)
评论(0)
推荐(0)
摘要:
#include"iostream"int main(int argc, char **argv) { std::stringstr; for (size_ti = 0; argv[i]; ++i)str += argv[i]; std::cout<< str << std::endl; re... 阅读全文
posted @ 2014-07-18 21:06
wu_overflow
阅读(101)
评论(0)
推荐(0)
摘要:
#include"iostream"#include"stdexcept"using namespace std;int main(){ int num,num2; while (cin>> num >> num2) {try {if (num2 == 0)throw runtime_erro... 阅读全文
posted @ 2014-07-18 21:06
wu_overflow
阅读(182)
评论(0)
推荐(0)
摘要:
#include"iostream"using namespace std;//返回c第一次出现的位置//引用形参负责统计c出现的次数string::size_type foo(const string &s, char c,string::size_type &occurs){ auto r... 阅读全文
posted @ 2014-07-18 21:06
wu_overflow
阅读(153)
评论(0)
推荐(0)
摘要:
#include "iostream"#include "string"#include "cctype"#include "vector"using namespace std;int main(){ vectorstr; stringt;//结束输入需要Ctrl+Z while (cin>... 阅读全文
posted @ 2014-07-18 21:06
wu_overflow
阅读(1002)
评论(0)
推荐(0)
摘要:
#include"iostream"#define ARR_SIZE(a)(sizeof((a)) / sizeof((a[0])))int a[] = {1, 23, 32, 0, 2, 5, 23};void insert_sort(int *a, int n) { int i, j,te... 阅读全文
posted @ 2014-07-18 21:06
wu_overflow
阅读(207)
评论(0)
推荐(0)
摘要:
吹きすさぶ风の中で(猛烈吹拂的风中)崖っぷちを仆等は駆ける(我们急奔在悬崖边)决して后ろを振り向かない(绝对不能回头)一言も言叶は喋らず(一句话也没说)いつの日も忏悔する事もなく(什么时候也没有让我们后悔的事)空を见上げりゃ激しい雨が降りかかる(仰望向天空 猛然倾盆而下的暴雨)収まったかと思え... 阅读全文
posted @ 2014-07-18 21:06
wu_overflow
阅读(105)
评论(0)
推荐(0)
摘要:
听说过一个关于水池和泥潭的理论,说是一个孩子扔出了一枚石子,如果丢进了水池,水池会用涟漪来积极地回应而如果扔进了泥潭,泥潭则不为所动,丝毫不去理会。什么意思呢?你或是别人可能就是那个孩子,你说出的话,或是表达出的暗示就是那枚石子,别人,或者就是你,就可能是那水池或是泥潭,你是会积极地回应呢,还... 阅读全文
posted @ 2014-07-18 21:06
wu_overflow
阅读(134)
评论(0)
推荐(0)
浙公网安备 33010602011771号