`
文章列表

1005

  总时间限制: 1000ms 内存限制: 65536kB 描述 Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land, he learned that the state of Louisiana is actually shrinking by 50 square miles each year, due to erosion caused ...

1004

总时间限制: 1000ms 内存限制: 65536kB 描述 Larry graduated this year and finally has a job. He's making a lot of money, but somehow never seems to have enough. Larry has decided that he needs to grab hold of his financial portfolio and solve his financing problems. The first step is to figure out what's bee ...

1003

总时间限制: 1000ms 内存限制: 65536kB 描述 How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're assuming that the cards must be perpendicular to the table.) With two cards you can make the top card overhang the botto ...
头文件是stdlib.h   用double atof(char *)可以 用double strtod(char * ,char **)也可以,用这个函数时,一般第二个参数设置为NULL   #include <iostream>#include <stdlib.h>using namespace std; void main(){ char t[100]="3.14159"; double x; x=atof(t); cout<<x<<endl; x=strtod(t,NULL); cout<<x& ...

1002

总时间限制: 2000ms 内存限制: 65536kB 描述 英文字母(除Q和Z外)和电话号码存在着对应关系,如下所示: A,B,C -> 2 D,E,F -> 3 G,H,I -> 4 J,K,L -> 5 M,N,O -> 6 P,R,S -> 7 T,U,V -> 8 W,X,Y -> 9 标准的电话号码格式是xxx-xxxx,其中x表示0-9中的一个数字。有时为了方便记忆电话号码,我们会将电话号码的数字转变
转帖: 这个问题, 谭浩强的C语言设计第二版没有讲清楚,或者没有讲。 查了查其它的资料,总算搞清楚了。 getch()、getche()和getchar()函数 (1) getch()和getche()函数 这两个函数都是从键盘上读入一个字符。 其调用格式为: getch(); getche(); 两者的区别是: getch()函数不将读入的字符回显在显示屏幕上, 而getche() 函数却将读入的字符回显到显示屏幕上。 例1: #include main() { char ...

1001

总时间限制: 500ms 内存限制: 65536kB 描述 Problems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many computer systems. This problem requires that you write a program to compute the ...
qsort函数用法   qsort   功 能: 使用快速排序例程进行排序    用 法: void qsort(void *base, int nelem, int width, int (*fcmp)(const void *,const void *));    各参数:1 待排序数组首地址 2 数组中待排序元素数量 3 各元素的占用空间大小 4 指向函数的指针 用于确定排序的顺序 排序方法有很多种, 选择排序,冒泡排序,归并排序,快速排序等。 看名字都知道快速排序 是目前公认的一种比较好的排序算法(我没听书速度比这快的了,特殊场合例外),比选择排序,冒泡排序都要快。这 ...
 **************************************************双向链表******************************************** 我们已经写过单链表了,为了更好的实现增删操作,我们可以构建想想链表 既然是双向链表,肯定是父节点能够找到子节点,子节点能够找到父节点。 既然是链表,那它的物理位置可以不相邻,如果相邻那就是数组了。 在双向链表中,节点除含有数据域外,还有两个链域,一个存储直接子地点地址,一般 被称为右链域,一个存储直接父节点地址,一般称为左链域。                     数据1     ...
 一直没写什么总结,因为我觉得没什么我觉得很有意义的东西。 说实话,说道android RPG游戏我就热情高涨,我想要做一个画面感很强的游戏, 出于热情,我开始研究,大约一个星期左右,参考各种资料,我终于写出了一个 ...
ListView(列图示表) 是一个常用的组件,其数据内容以列表形式直观的展示出来,列如一个游戏的 排行榜,对话列表等等都可以使用列表来实现,且ListView的优点是列表中的 数据可以自适应屏幕大小。   在列表中定义的数据都通过“适配器”来映射到ListView上,ListView中常用 的适配器有两种: ArrayAdapter:  最简单的适配器,只能显示一行文字。 SimpleAdapter:  具有很好的扩展性的适配器,可以显示自定义内容。 首先,先展示下ArrayAdapter适配器的项目 步骤如下: (1)实例一个添加数据的容器,并将数据放入容器。 ( ...
View的基本概念: Activity显示的所有控件的父类都是View:  上面试View类,下面都是View的子类 (2)对View类设置监听器的步骤:           1)获取代表控件对象           2)定义一个类,实现监听接口          3)生成监听器对象           4)为控件绑定监听器对象   (3)控件布局 控件布局的基本概念:         所谓的控件布局方法,就是指控制控件在Activity当中的位置,大小,颜色以及吉他控件样式属性的方法。          1)使用布局文件完成控件布局(使用方便,但四班,不灵活)   ...
安卓四大组件: 组件一:Activity: 是整个应用程序的门户,主要负责与用户进行交互,每一个Activity就是一个界面,上面有各种容器。 就相当于一个网站有很多网页,每一个网页就相当于一个Activity。 组件二:Service: Andriod里面的劳模,帮安卓完成一些耗时较长的操作,在后台默默的工作。 组件三:Content Provider: 是数据的共享的方法。负责对外提供数据,并允许有需要的应用程序访问这些数据。 组件四:BroadCast Receiver: 监听手机中发生的一切事情,监听系统的行为。     组件一: (1)Activity的启 ...
学习的思路最重要,房子能砌的多高,取决于你的  眼光; 所以设计非常重要,一个好的设计能让你的程序有更好的拓展性; 下面就是我在这个架构下做出的拓展:    实现了图片的传输; 下面是我附上我写的代码      
初识通信:什么是通信?什么是端口? 首先,我们来看看点对点聊天: 1.我们先创建一个服务器对象,为了能够同时存在多个客户端,我们选择了多线程操作;   public class Jtp { public static void main(String[] args) { Jtp cs = new Jtp() ; cs.setUpServer(9090) ; } public void setUpServer(int port){ try{ //建立绑定在指定端口上的服务器对象 ServerSocket server = new ...
Global site tag (gtag.js) - Google Analytics