上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 54 下一页

2012年2月19日

C#读取文件:按行读取

摘要: C#如何读取文件前面说过了:http://blog.csdn.net/yysyangyangyangshan/article/details/6948327,下面以一个例子来说明如何按行读取,其实很简单,就是使用FileStream的ReadLine()方法。例如有这样一个文件test.txt,读取出来显示在一个richtextbox中,文件内容如下:诺基亚 =N8摩托罗拉 =ME525+华为 =HONORHTC=A3366/T9299读取方法为: public static Dictionary<string, string> ReadLineFile() { ... 阅读全文

posted @ 2012-02-19 16:20 c语言源码 阅读(1800) 评论(0) 推荐(0) 编辑

VB.net 将dataGridView中的数据导出到excel

摘要: 今天做机房收费系统做到了报表打印部分了。 在将dataGridView中的数据导出到excel时,到网上找了一些相关的内容,个人感觉不是太好,有的在复杂了。 下面是简单的实现dataGridView数据到excel: 当然首先要添加引用:Microsoft.Office.Interop.Excel Dim MyExcel As New Microsoft.Office.Interop.Excel.Application() MyExcel.Application.Workbooks.Add() MyExcel.Visible = True ... 阅读全文

posted @ 2012-02-19 15:59 c语言源码 阅读(534) 评论(0) 推荐(0) 编辑

2012年2月18日

数据库设计文档模板

摘要: 《项目名称》数据库设计文档数据库版本:Oracle10g命名空间:TESTNAMEPACE一、数据库表序列表名功能说明1Test1表2Test2表3Test3表4Test4表二、数据库表关系图三、数据库表信息Test1表名/缩写Test1功能描述列名数据类型空说明idint否表id约束:唯一补充说明四、sql语句1、创建表create table BM_ADMIN( idINTEGER not null,… )2、存储过程create or replace procedure testprocedure() 阅读全文

posted @ 2012-02-18 18:36 c语言源码 阅读(749) 评论(0) 推荐(0) 编辑

POJ 1840 Eqs

摘要: 思路:a1x1^3+ a2x2^3+ a3x3^3 = -(a4x4^3 + a5x5^3)先求出右边能到达的值,对值进行hash,然后左边查询计数,这样比相反的顺序内存少用好多,时间也快不少#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #define inf 20003 int Max(int a,int b){ return a>b?a:b; } int Min(int a,int b){ return a>b?b:a; } int 阅读全文

posted @ 2012-02-18 17:35 c语言源码 阅读(230) 评论(0) 推荐(0) 编辑

BOJ 262 Channel Coding

摘要: DescriptionAssume an integer sequence contains N elements whose value could only be one of {0, 1, -1}. There may exist a positive integer D which can make the sum between i-th element and (i+D)-th element be zero, where i is a certain integer between 1 and N-D. Your task is to find out the maximal D 阅读全文

posted @ 2012-02-18 17:32 c语言源码 阅读(174) 评论(0) 推荐(0) 编辑

POJ 3274 Gold Balanced Lineup

摘要: hash存储,查询,跟POJ 3349类似#include<stdio.h> #include<stdlib.h>; #include<string.h> #define inf 100001 struct Edge{ int pos[32],next; }edge[100100]; int head[100100],max,num[100100],k; int Max(int a,int b){ return a>b?a:b; } int add(int b,int pos){ int i,j; int hash=b%inf; for(i=head[ 阅读全文

posted @ 2012-02-18 14:23 c语言源码 阅读(137) 评论(0) 推荐(0) 编辑

POJ 3349 Snowflake Snow Snowflakes

摘要: 简单hash#include<stdio.h> #include<stdlib.h>; #include<algorithm> #define inf 100001 using namespace std; struct Edge{ int a[10],next; }edge[100100]; int a[10],head[100100],cnt; bool add(int * b){ int sum=0,i,j,p,q; for(i=0;i<6;i++) sum+=b[i]; int hash=sum%inf; for(i=head[hash];i; 阅读全文

posted @ 2012-02-18 11:06 c语言源码 阅读(404) 评论(0) 推荐(0) 编辑

2012年2月17日

POJ 3683 Priest John's Busiest Day

摘要: 2-SAT经典问题#include<cstdio> #include<string.h> #include<math.h> #include<stack> #define N 2010 #define M N*N*3 using namespace std; struct edge{ int v,next; }edge[M]; int n; int s[N],t[N],seq[N]; int cnt,head1[N],head2[N],head3[N]; int scc,index,dfn[N],low[N],belong[N]; int top 阅读全文

posted @ 2012-02-17 22:06 c语言源码 阅读(190) 评论(0) 推荐(0) 编辑

(转载)C#richTextBox中的内容换行

摘要: 要让一个TextBox显示多行文本就得把它的Multiline属性设置为true,可是如果你是要把TextBox的Text属性设置多行文本时可能会遇到点麻烦,也许你会想到直接加一个换行符"\n":TextBox1.Text = "First Line\nSecond Line\nThird Line";可是实际运行的时候你却发现它始终不会换行,显示的结果为"First LineSecond LineThirdLine"。其实主要是因为TextBox运行在Windows上。Windows能够显示的换行必须由两个字符组成:"\r 阅读全文

posted @ 2012-02-17 19:21 c语言源码 阅读(10233) 评论(0) 推荐(0) 编辑

2012年2月16日

POJ 3160 Father Christmas flymouse

摘要: 很简单的一道题,先tarjan缩点,然后SPFA求最长路。#include<cstdio> #include<string.h> #include<math.h> #include<queue> #define N 30100 #define M 150100 using namespace std; struct edge{ int v,next; }edge[M]; int n,m; int num[N]; int cnt,head1[N],head2[N]; int scc,index,dfn[N],low[N],belong[N],sum 阅读全文

posted @ 2012-02-16 22:08 c语言源码 阅读(133) 评论(0) 推荐(0) 编辑

上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 54 下一页

导航