js也有趣。

<html> <head> <title>找最接近的数</title> <meta charset="utf-8"> </head> <body > <p> 问题描述:有一堆若干金条,从中任选几条,使其重量之和与另一给定的数量最接近。 </p> <br> <script> var v=new Array(); var a=new Array(); var r_value=new Array(); var n=parseInt(prompt("总共的金块条数有:","")); for (...
2020-10-24 22:17 | 阅读 1347 次 | 评论 2 条

欢度春节

http://www.qunxingw.wang/happy_new_year.phphttp://www.qunxingw.wang/happy_new_year.php
2019-02-04 14:57 | 阅读 1083 次 | 评论 0 条

RSA

1,求模的运算: (m1.m2)%n=(m1%n.m2%n)%n 2,幂运算优化:M^e%n 如果 e偶数,就变为: ((M^e/2)%n. (M^e/2)%n)%n 其他 :(M^(e-1)%n.M%n)%n <html> <head> <meta charset="utf-8"/> <title> RSA 加密,解密 </title> </head> <body> <script> //e.d=(p-1)(q-1)K+1; //求密钥d; function pri_key(e,p,q...
2018-06-17 12:49 | 阅读 1319 次 | 评论 0 条

virtualenv win cmd下建立虚拟环境

virtualenv win cmd下建立虚拟环境 ...>pip virtualenv (安装) ...>virtualenv myvenv (新建) ...>cd myvenv ...>cd scripts ...>activate.bat (myvenv)...> (进入了虚拟环境状态) ....>de...
2016-12-26 17:32 | 阅读 2032 次 | 评论 0 条

android工程不能运行java main程序的解决方法

>>>>鼠标右键 >>>> Run Configurations >>>>双击java application >>>> 单击有main方法的类 >>>>选中classpath选项卡 >>>>remove掉... Entries下的android.jar
2016-08-06 11:46 | 阅读 2265 次 | 评论 0 条

拼接sql 字符串,一定留意空格符,错误好难找。

拼接sql 字符串,一定留意空格符,错误好难找。
2016-07-19 15:50 | 阅读 5129 次 | 评论 0 条

多线程下载2

public class DownMainActivity extends Activity { private static final int PROCESSING = 1; private static final int FAILURE = -1; private EditText pathText; // url地址 private TextView resultView; private Button downloadButton; private Button stopButton; private ProgressBar progressB...
2016-01-03 15:03 | 阅读 2065 次 | 评论 0 条

线程基础

public class MainActivity extends Activity { /*1*** 使用Thread的继承创建进程 ***/ public class MyThread extends Thread{ private int count=0; public void run(){ while(count<100){ count++; Log.i("======run=====", "count="+count); System.out.println("线程"); } } } /************使用run...
2016-01-02 19:22 | 阅读 1529 次 | 评论 0 条

android 数据存储简介

e本文介绍Android中的5种数据存储方式。 数据存储在开发中是使用最频繁的,在这里主要介绍Android平台中实现数据存储的5种方式,分别是: 1 使用SharedPreferences存储数据 2 文件存储数据 3 SQLite数据库存储数据 4 使用ContentProvider存储数据 5 网络存储数据 下面将为大家一一详细介绍。 第一种: 使用SharedPreferences存储数据 SharedPreferences是Android平台上一个轻量级的存储类,主要是保存一些常用的配置比如窗口状态,一般在Activity中 重载窗口状态onSaveInstanceSta...
2015-10-12 12:07 | 阅读 1724 次 | 评论 0 条

android Studio安装

http://www.cnblogs.com/timeng/archive/2013/05/17/3084185.html http://jingyan.baidu.com/article/67662997393cf654d51b8435.html http://segmentfault.com/a/1190000002401964 http://blog.csdn.net/zhoujn90/article/details/8957713 http://www.linuxidc.com/Linux/2014-09/106914...
2015-07-01 20:56 | 阅读 1711 次 | 评论 0 条

oracle安装链接及常见异常避免和解决

http://www.cnblogs.com/zhengcheng/p/4170773.html 在64位Windows 7 系统下安装Oracle Database 11g 的过程中,出现提示:“未找到文件 E:\app\Administrator\product\11.2.0\dbhome_1\owb\external\oc4j_applications\applications\WFMLRSVCApp.ear”,分析估计是文件没有全部复制到安装目录的原因, 解决方法如下: 将下载下来的两个Zip文件,分别解压到不同的文件夹。这样会得到两个文件夹:win64_11gR2_da...
2015-04-19 19:47 | 阅读 1713 次 | 评论 0 条

网页小游戏

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>点我啊</title> <style type="text/css"> i...
2015-03-22 20:54 | 阅读 2035 次 | 评论 0 条

JAVA练习

import java.util.*; /*用相关函数练习双色球。*/ public class Caipiao { public static void main(String[] args){ List<Integer> list=new ArrayList<Integer>(); List<Integer> listcai=new ArrayList<Integer>(); for(int i=0; i<33; i++){//从1到33的数添加到LIST集里 list.add(i+1); } Random rd=new Random(); for(i...
2015-01-23 20:27 | 阅读 2135 次 | 评论 0 条

异或运算加密与解密练习

根据 a=b^c 相互关系。 #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int i,j,len,len_one; char one[10000],two[10000];//one[]为密钥,two[]为明文 printf("请输入明文:"); gets(two); printf("请输入密钥:"); gets(one); len_one=strlen(one); len=strlen(two); f...
2013-09-19 18:40 | 阅读 2379 次 | 评论 0 条

10进制转换其他进制

#include <stdio.h> #include <stdlib.h> void output(int a,int n)//10进制转换 其他进制。 { char s[16]={"0123456789ABCDEF"}; if(a/n==0) { printf("%c",s[a%n]); return; } output(a/n,n); printf("%c",s[a%n]); } int main(int argc, char *argv[]) { i...
2013-08-30 12:27 | 阅读 2022 次 | 评论 0 条

双色球,红球遍历

#include <stdio.h> #include <stdlib.h> #define max 33 #define num 6 int main() { FILE *FP; FP=fopen("CAIPIAO.txt","w+"); int i,j,k,l,m,n,o; int b[num]; for(i=6;i<=max; i++) { b[0]=i; for(j=5;j<i; j++) { b[1]=j; ...
2013-07-15 22:25 | 阅读 2307 次 | 评论 0 条

结构体

#include<stdio.h> struct WORK { int begin; int end; int value; }; int main() { int i; WORK worke[5]; for(i=0; i<5; i++) scanf("%d%d%d",&amp;worke[i].begin,&amp;worke[i].end,&amp;worke[i].value); for(i=0; i<5; i++) printf("%d,%d,%d\n",worke[i].begin,worke[...
2013-06-25 16:01 | 阅读 1744 次 | 评论 0 条

动态规划练习3

引题 http://bbs.bccn.net/viewthread.php?tid=414177&amp;extra=&amp;page=1 加工工件获取最大价值的问题,为了便于理解学习核心的部分,把题目分解: 开始时间,结束时间,加工工件价值,分别用三个数组表示。 以结束时间排序好。 动态转移方程直接在递归式中表现。 f(i,j)表示至第i个工件时结束时间为j时 累加最大价值。 主要意思是,选取第i个工件时,和不取第i个工件时情况的价值中取较大值。 通俗的讲,当取第i个工件时,此时选取后的 j 值为第i个工件的开始时间,不选 i工件 时此时的j值为(i-1)工件的结束时间。 #in...
2013-06-25 12:39 | 阅读 2081 次 | 评论 0 条

湖南高考数列题

有数列a(n)满足:2a(n)-a(1)=s(n)s(1);其中n是正整数,s(n)为各项之和,a(1)不等于0; 1,求,a(1),a(2)的值; 并求,a(n)的通项; 2,求数列n*a(n)各项之和; 以下为递归实现。 #include<stdio.h> int s(int n); int sum(int n); int f(int n)//a( n)=s(n-1)+1 { if(n==1) return 1; return s(n-1)+1; } int s(int n)//s(n)=s(n-1)+a(n) { if(n...
2013-06-11 21:24 | 阅读 3203 次 | 评论 2 条

组合数显示

#include<stdio.h> #define MAXN 4 #define NUM 8 int num[NUM],temp[MAXN]; void combine ( int n,int m) { int i,j; for(i=n; i>=m; i--) { temp[m-1]=num[i-1]; if(m>1) combine(i-1,m-1); else for(j=MAXN-1;j>=0; j--) printf("%2d",temp[j]); printf("\n"); ...
2013-05-25 23:14 | 阅读 1716 次 | 评论 0 条
浏览232709次
最新评论