`
文章列表
眼瞅着就要大四的人了,大学里参加竞赛还是第一次,这次参赛或许是为了圆了自己参加 竞赛的愿望,虽然早就有参加竞赛的冲动,特别地acm大赛---我们计算机自己的大赛。但 每次看到有竞赛的时候,发现自己都没有什么准备 ...
引用与指针的区别:   常常有人问引用与指针的区别,可能是指针和引用在功能上的相似,而是他们混淆这两个概念, 现在总结以下二者的区别,希望大家能彻底弄清这两个概念根本性的差别:   引用,一个变量的别名,为什么引入别名呢?原因是我们想定义一个变量,他共享另一个变量的 内存空间,使用别名无疑是一个好的选择。变量是什么?是一个内存空间的名字,如果我们给这个 内存空间在起另外一个名字,那就是能够共享这个内存了,引用(别名)的由此而来。   指针,指向另一个内存空间的变量,我们可以通过它来索引另一个内存空间的内容,本身有自己的 内存空间。   二者区别:(1)引用访问一个变量是直接访问,而指针是间接访问 ...
用java写了一个实用的类----递归的拷贝给定目录的.java文件到指定的一个文件中 当然可以扩展一下,做成一个实用的工具,做一下界面,增加一个可选择的后缀名...呵呵,自己懒的要命,有兴趣可以作一下,感觉这个工具还挺实用的,不需要你手工一个个复制,粘贴,只需要输入你要拷贝的目录和要拷贝到的文件的名字,成百上千的文件就会替你拷贝的好好的...呵呵,不过拷贝的次序不确定,我的那个SNLCompiler代码就是用这个把数百个文件合成一个文件贴到blog里的,阅读起来可能有困难... package edu.jlu.fuliang; import java.io.*; public ...

JOJ ACM 1149

Given a positive integer n, nd the positions of all 1's in its binary representation. The position of the least significant bit is 0. Example The positions of 1's in the binary representation of 13 are 0, 2, 3. Task Write a program which for each data set: reads a positive integer n, ...

JOJ ACM 1107

 
The most important part of a GSM network is so called Base Transceiver Station (BTS). These transceivers form the areas called cells (this term gave the name to the cellular phone) and every phone connects to the BTS with the strongest signal (in a little simplified view). Of course, BTSes need some ...

JOJ ACM 1146

For each list of words, output a line with each word reversed without changing the order of the words. This problem contains multiple test cases! The first line of a multiple input is an integer N, then a blank line followed by N input blocks. Each input block is in the format indicated in the probl ...

JOJ ACM 1148

A prime number is a counting number (1, 2, 3, ...) that is evenly divisible only by 1 and itself. In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between (and including) 1 and N. Your program will read in a number N; determine the l ...

JOJ ACM 2155

Mr. Jojer has written an article, but now he wants to make a copy of it and check out how many characters he has used. Input and Output You will be given an article, you should output this article again and how many characters are there. Sample Input FerrAriS and Jojer are friends. Sample Output F ...

JOJ ACM 1237

1237 A character string is said to have period k if it can be formed by concatenating one or more repetitions of another string of length k. For example, the string "abcabcabcabc" has period 3, since it is formed by 4 repetitions of the string "abc". It also has periods 6 (two re ...
1、你的类需要构造函数么? 对于一个复杂的类,我们要隐藏掉复杂的细节,而让用户看到一个简洁的界面, 构造函数对于隐藏内部的工作方式非常重要,因为他设定了整个程序的初始状 态,我们只把需要由用户设定的数据,作 ...
//************************************************************ //游戏:每次产生5个食物,通过上下左右键控制蛇的运动方向 //************************************************************* //********************************************** //游戏的类,控制其他各个类和游戏的进度 //********************************************** import ja ...
Rails框架纵览: 学习Rails框架也好几个月了,不过这段时间忙着考研复试,忘了不少了,总结一下,找回点感觉,好做毕业设计。 Ruby on Rails的两大箴言:约定优于配置(Convetion over configuration)和DRY(Don’t repeated yourself)造就了Rails 的极高的开发效率,使Rails框架迅速风靡世界,现在可以说是红的发紫。   Ruby on Rails框架,是一个使web应用的开发、部署和维护变得更容易的框架,Rails框架非常适合进行敏捷开发和基于测试驱动开发,因为整个框架的设计,就将测试放在了很高的位置,你每生成一个Mo ...
现在csdn的blog也上不去,只能通过网页快照,并且还有些链接不好使,今天到此为止了,以后有空再说。
//贪心法解决单源最短路经问题 //定点v表示源,a为图的邻接矩阵,dist[i]表示源到顶点i的最短路经长度 //prev[i]表示最短路经中i顶点的前驱顶点 #define MAX_DISTANCE 100000 void Shortest_Path(int v,float **a,float dist[],int prev[],int n){ if(v < 1 || v > n) return; bool *s = ( bool* )malloc( n * sizeof(bool) );//记录是否为s集合中的 //元素 for(int i ...
题目: 已知螺旋线方程: z=r*cos(t*k); x=r*sin(t*k); y=300*t; (k=m*3.14/180*360 m=10) r为半径,t为时间,k为螺旋线的圈数控制量 分别采用红、绿、蓝三色画出宽度为4且圈数是10的螺旋线 沿X,Y,Z三轴正向的平行投影图形。 实现代码: void CDrawSpringView::OnDraw(CDC* pDC) { CDrawSpringDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw c ...
Global site tag (gtag.js) - Google Analytics