- 博客(29)
- 收藏
- 关注
原创 hdu 1002大数加法
第一次没有依赖Java的BigInteger,自己用C语言手写模拟,代码如下。注意,最后一行不要打印两个空格。欢迎各路大神提出意见。#include <stdio.h>#include <string.h>char a[1005], b[1005];int ans[1005];int max(int m, int n) { if(m > n) return m;
2017-03-11 22:58:07
429
原创 ExtJS弹出框保存并退出
Ext.Msg.alert('提示', '保存成功!', function() { button.up('window').close();});
2017-02-17 11:46:46
764
原创 JavaScript函数学习笔记
函数对任何语言而言都是核心的概念。ECMAScript中,函数的声明通过function关键字,后面跟着一组参数以及函数体。 函数声明的基本语法如下:function functionName(arg0, arg1, ..., argN) { // 函数体}例如,function myFunc(name) { alert('Hello, ' + name);}若参数有多个,
2016-12-05 18:10:30
456
原创 jquery, highcharts, Ajax读取json数据
highcharts结合jquery和ajax的方法读取和展现json数据。先上代码和结果。 首先,给出相关的data.json文件中的json数据:{ "success": true, "code": "0", "msg": "", "data": { "AxisNames": [ "日", "报单人次" ], "AxisUnit"
2016-11-28 16:06:57
2610
原创 HTML5自适应手机屏幕
从网上学到的自适应代码,用于HighCharts报表 使用js进行自适应控制,代码如下:<script type="text/javascript"> var phoneWidth = parseInt(window.screen.width); var phoneScale = phoneWidth/640; var ua = navigator
2016-11-10 16:48:05
8263
原创 JavaScript获取当前时间并动态显示
首先,定义一个时间类var mydate = new Date();下面是获取年月日时分秒的方法:// 获取年份var year = mydate.getFullYear();// 获取月份,因为月份的表示范围是(0-11), 所以在后面加1var month = mydate.getMonth() + 1;// 获取日期,就是今天是几号,它的范围是(1-31)var day = myda
2016-08-27 10:48:38
1708
原创 Java空串和null串
空串 空串”“是长度为0的字符串,也是一个Java对象。可以用以下代码if(s.length() == 0) 或者 if(s.equals(""))检查一个字符串s是否为空。如果为空,返回true,否则返回false。 - null串 String变量还可以存放一个特殊的值null,表示没有任何变量与该变量相关联,采用以下判断语句:if(s == null)检查一个字符串是否为null。
2016-08-26 20:58:14
1406
原创 C. Hexadecimal's Numbers
C. Hexadecimal’s Numbers time limit per test1 second memory limit per test64 megabytes inputstandard input outputstandard output One beautiful July morning a terrible thing happened in Mainframe:
2016-07-06 10:04:40
386
原创 Codeforces Round #360 (Div. 2) A. Opponents
#include <iostream>#include <cstring>#include <string>using namespace std;const int maxn = 105;int a[maxn], sum[maxn];int main() { int n, d; string s; memset(a, 0, sizeof(a)); memse
2016-07-05 19:10:19
270
原创 阿里云服务器连接
最近刚开始玩阿里云服务器,本人较菜,连接阿里云时还费了一段时间,因此把连接过程记录下来,供大家一次参考哈~~1、登录自己的阿里云账户 2、在管理控制台中,进入实例,然后点击右侧的更多,连接管理终端 3、输入管理终端密码 4、登录之后就成功了
2016-07-02 11:41:06
1114
原创 PAT 1035. Password (20)
题目描述: To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish 1 (one) from
2016-07-01 23:56:33
303
原创 PAT 1059. Prime Factors (25)
题目描述 Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p1^k1 * p2^k2 *…*pm^km.Input Specification:Each input file contains one test case
2016-06-28 23:58:50
386
原创 LeetCode 196. Delete Duplicate Emails
Delete Duplicate Emails My Submissions QuestionEditorial Solution Total Accepted: 14121 Total Submissions: 73321 Difficulty: Easy Write a SQL query to delete all duplicate email entries in a table na
2016-06-26 22:02:07
351
原创 LeetCode 197. Rising Temperature
题目描述: 197. Rising Temperature My Submissions QuestionEditorial Solution Total Accepted: 16455 Total Submissions: 62463 Difficulty: Easy Given a Weather table, write a SQL query to find all dates’ Id
2016-06-26 21:40:57
490
原创 二分查找(递归和非递归写法)
#include <iostream>#include <algorithm>using namespace std;const int maxn = 10005;int a[maxn];// 递归写法int binary_search(int a[], int x, int l, int h) { if(l <= h) { int mid = (l + h) / 2
2016-06-26 15:28:06
482
原创 PAT 1007. Maximum Subsequence Sum (25)
问题描述: Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is defined to be { Ni, Ni+1, …, Nj } where 1 <= i <= j <= K. The Maximum Subsequence is the continuous subsequence whic
2016-06-26 11:32:09
258
原创 PAT 1053. 住房空置率 (20)
题目描述:在不打扰居民的前提下,统计住房空置率的一种方法是根据每户用电量的连续变化规律进行判断。判断方法如下:在观察期内,若存在超过一半的日子用电量低于某给定的阈值e,则该住房为“可能空置”;若观察期超过某给定阈值D天,且满足上一个条件,则该住房为“空置”。 现给定某居民区的住户用电量数据,请你统计“可能空置”的比率和“空置”比率,即以上两种状态的住房占居民区住房总套数的百分比。输入格式:输入第
2016-06-24 14:52:56
891
原创 PAT 1050. 螺旋矩阵(25)
题目描述: 本题要求将给定的N个正整数按非递增的顺序,填入“螺旋矩阵”。所谓“螺旋矩阵”,是指从左上角第1个格子开始,按顺时针螺旋方向填充。要求矩阵的规模为m行n列,满足条件:m*n等于N;m>=n;且m-n取所有可能值中的最小值。输入格式:输入在第1行中给出一个正整数N,第2行给出N个待填充的正整数。所有数字不超过104,相邻数字以空格分隔。输出格式:输出螺旋矩阵。每行n个数字,共m行。相邻数字
2016-06-21 10:18:08
823
原创 1052. 卖个萌 (20)
题目描述: 萌萌哒表情符号通常由“手”、“眼”、“口”三个主要部分组成。简单起见,我们假设一个表情符号是按下列格式输出的:左手[右手] 现给出可选用的符号集合,请你按用户的要求输出表情。输入格式:输入首先在前三行顺序对应给出手、眼、口的可选符号集。每个符号括在一对方括号[]内。题目保证每个集合都至少有一个符号,并不超过10个符号;每个符号包含1到4个非空字符。之后一行给出一个正整数K,为用户请求
2016-06-16 22:34:04
305
原创 poj 2406 Power Strings
问题描述: Power Strings Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 42056 Accepted: 17526 DescriptionGiven two strings a and b we define a*b to be their concatenation. For ex
2016-06-16 00:28:03
297
原创 UVA455 Periodic Strings
题目描述: Periodic Strings 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”
2016-06-15 23:57:18
254
原创 PAT: 1001. A+B Format (20)
问题描述: Calculate a + b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits).InputEach input file contain
2016-06-14 18:09:53
291
原创 PAT Basic 1045. 快速排序(25)
问题描述: 著名的快速排序算法里有一个经典的划分过程:我们通常采用某种方法取一个元素作为主元,通过交换,把比主元小的元素放到它的左边,比主元大的元素放到它的右边。 给定划分后的N个互不相同的正整数的排列,请问有多少个元素可能是划分前选取的主元?例如给定N = 5, 排列是1、3、2、4、5。则:1的左边没有元素,右边的元素都比它大,所以它可能是主元; 尽管3的左边元素都比它小,但是它右边的2它小
2016-06-14 00:50:09
387
原创 PAT Basic 1040. 有几个PAT(25)
问题描述: 字符串APPAPT中包含了两个单词“PAT”,其中第一个PAT是第2位(P),第4位(A),第6位(T);第二个PAT是第3位(P),第4位(A),第6位(T)。 现给定字符串,问一共可以形成多少个PAT? 输入格式:输入只有一行,包含一个字符串,长度不超过105,只包含P、A、T三种字母。输出格式:在一行中输出给定字符串中包含多少个PAT。由于结果可能比较大,只输出对100000
2016-06-14 00:42:01
471
原创 poj 3047 Bovine Birthday
题目大意:给出年月日,求这一天是星期几 Java Calender类直接水过。。。注意,Java的Calendar类中月份从0月开始,所以月份要记得减一下面直接贴代码:import java.util.Calendar;import java.util.Scanner;public class Main { public static void main(String[] args) {
2016-06-08 00:49:00
445
原创 poj3048 Max Factor
POJ 3048 Max Factor题目简介:给N个数(1 <= N <= 5,000),每个数的范围是1..20,000,输出他们中素因子最大的那个数。
2016-06-07 18:01:52
940
1
原创 Linux环境下jdk的配置
刚刚涉及Linux操作系统,由于对Linux系统的操作不是很熟悉,走了很多弯路,特地在此把Linux操作系统下配置jdk的过程记录下来。我是在centOS的Linux虚拟机上配置的。步骤如下:首先以root的身份登录Linux操作系统,将jdk的解压缩文件jdk-6u45-linux-x64.bin放在/usr/java目录下,打开终端,先授权:chmod 777 jdk-6u45-linux
2016-03-23 20:48:53
513
原创 第一篇博文
这是我的第一篇博客,不是技术性的,只是做个简要的介绍。现在我还是一名大学生,掌握的知识还太浅,从现在起,我会把我每天学到的东西都记载到我的博客上,作为自己的知识储备,让自己发展更好。有新的东西希望和大家分享,也希望能够得到大家的支持,谢谢!
2016-03-23 16:41:58
307
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人