码迷,mamicode.com
首页 >  
搜索关键字:using    ( 53562个结果
C++求两个数的最大值
//求两个数字中最大的那个数字。 #include using namespace std; int main() { int a = -10; int b = -100; int c = (a + b + abs(a - b))/2; //abs(x)是求绝对值的函数,a+b+(a与b的差值)就是最大数的两倍,再除以2即为最大数。 cout <<...
分类:编程语言   时间:2015-06-24 21:06:24    阅读次数:144
VC++读取图像RGB值
代码: #include #include #include #include #include #pragma comment(lib, "gdiplus.lib") using namespace std; using namespace Gdiplus; int main() { GdiplusStartupInput gdiplusstartupinput;...
分类:编程语言   时间:2015-06-24 18:57:20    阅读次数:240
排序算法系列之八大排序算法性能比较-从实验结果分析
回顾各大排序算法的实现代码: #include "stdafx.h" #include #include #include using namespace std; template void BubbleSort(T *x, const int N) { for(int k= N-1; k>0 ;k--) { for(int i=0; i<k; i++) { if(x...
分类:编程语言   时间:2015-06-24 18:51:40    阅读次数:279
SGU 296.Sasha vs. Kate(贪心)
题意: 给出长度为n(s[i-1]的位置,最优一定是删除s[i-1]的.累计次数t. 同时对新得到的数同样处理,这里可以只用一个循环.如果用c++ string的话更加方便. 一直处理到t==k,或者没有满足条件的位置。 如果最后删除的次数t#include using namespace...
分类:其他好文   时间:2015-06-24 18:45:28    阅读次数:113
一个农民工写的Json组件,让大神们情何以堪.
dll下载地址博客园不让上传文件,我放在百度网盘了废话少说,直接上图测试代码using System;#region#endregionnamespace Crylw.Json.Demo { [Debug] partial class DebugJsonWriter { s...
分类:Web程序   时间:2015-06-24 18:32:22    阅读次数:220
ajax+jquery+ashx如何实现上传文件
ajax+jquery+ashx如何实现上传文件第一:建立Default.aspx页面ajax图片上传二、新建一个一般处理文件Handler.ashxusing System;using System.Web;public class Handler : IHttpHandler {public v...
分类:Web程序   时间:2015-06-24 18:03:27    阅读次数:157
Codeforces Round #299 (Div. 2) A. Tavas and Nafas
题目链接:http://codeforces.com/problemset/problem/535/A#include #include using namespace std;int main() { string s1[10]={"zero","one","two","three","four","five","six","seven","eigh...
分类:其他好文   时间:2015-06-24 16:34:49    阅读次数:111
UVa 11577 - Letter Frequency
题目:给你一句话,统计里面出现最多的字母,有多个按字典序输出。 分析:简单题。直接统计即可。 说明:注意输入格式。 #include #include #include #include #include #include using namespace std; int main() { int n,count[27]; char buf[202]; while (...
分类:其他好文   时间:2015-06-24 16:27:47    阅读次数:123
Hyper LogLog介绍
大数据计算:如何仅用1.5KB内存为十亿对象计数 - Hyper LogLog 算法 Big Data Counting: How To Count A Billion Distinct Objects Using Only 1.5KThis is a guest post by ...
分类:其他好文   时间:2015-06-24 16:20:00    阅读次数:111
poj1160 post office
题目大意:有n个乡村,现在要建立m个邮局,邮局只能建在乡村里。现在要使每个乡村到离它最近的邮局距离的总和尽量小,求这个最小距离和。n 2 #include 3 #include 4 #define MAXN 305 5 using namespace std; 6 int f[MAXN][MAXN]...
分类:其他好文   时间:2015-06-24 16:16:06    阅读次数:112
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!