原创 Python基礎語法

Python程序的輸入輸出 -input()    從控制檯獲得用戶輸入的函數 input()函數的使用格式; <變量>=input(<提示信息字符>)    a=intput("請輸入a的值") -print()函數的使用格式; pr

原创 【轉】Sublime Text 3 全程詳細圖文使用教程

轉自: http://www.cnblogs.com/wind128/p/4409422.html 一、 前言        使用Sublime Text 也有幾個年頭了,版本也從2升級到3了,但猶如寒天飲冰水,冷暖儘自知。最初也是不知道

原创 JAVA_大數的階乘-----蒜頭君對階乘產生了興趣,他列出了前 1010 個正整數的階乘以及對應位數的表

    蒜頭君對階乘產生了興趣,他列出了前 1010 個正整數的階乘以及對應位數的表: nn n!n! 位數 1 1 1 2 2 1 3 6 1 4 24 2 5 120 3 6 720 3 7 5040 4 8 40320 5 9 36

原创 JAVA大數處理(BigInteger,BigDecimal)

  Ⅰ基本函數: 1.valueOf(parament); 將參數轉換爲制定的類型    比如 int a=3;        BigInteger b=BigInteger.valueOf(a);      則b=3;   

原创 java語言 L1-017 到底有多二 (15 分)

一個整數“犯二的程度”定義爲該數字中包含2的個數與其位數的比值。如果這個數是負數,則程度增加0.5倍;如果還是個偶數,則再增加1倍。例如數字-13142223336是個11位數,其中有3個2,並且是負數,也是偶數,則它的犯二程度計算爲:3

原创 Java中對Array數組的常用基本操作

聲明數組; 初始化數組; 查看數組長度; 遍歷數組; int數組轉成string數組; 從array中創建arraylist; 數組中是否包含某一個值; 將數組轉成set集合; 將數組轉成list集合; Arrays.fill()填充數組

原创 JAVA中Map的用法

Map 初始化 1 Map<String, String> map = new HashMap<String, String>(); 插入元素 1 map.put("key1", "value1"); 獲取元素 1

原创 基礎知識儲備-快速篩法求素數

普通的線性篩法: public class Main { static int N=1001; static int []prime=new int [N+1]; static int []su=new int [N+1];

原创 JAVA的常見類型轉換

java將int類型的變量轉化成String類型的 第一種方法:String的valueOf方法, int i=5; String s=String.valueOf(i); 第二種方法,直接在int後面加一個空的字符串,因爲在java裏面

原创 JAVA語言1031 Hello World for U (20 分)

1031 Hello World for U (20 分) Given any string of N (≥5) characters, you are asked to form the characters into the shap

原创 JAVA中sort()函數的使用方法的個人總結

1.sort()函數的基本格式(默認排序爲升序排序) Arrays.sort(int[] a, int fromIndex, int toIndex);Arrays.sort(數組名,起始下標,終止下標); 一個簡單的排序例子 impo

原创 1016. 部分A+B (15)

正整數A的“DA(爲1位整數)部分”定義爲由A中所有DA組成的新整數PA。例如:給定A = 3862767,DA = 6,則A的“6部分”PA是66,因爲A中有2個6。 現給定A、DA、B、DB,請編寫程序計算PA + PB。 輸入

原创 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

原创 1005. Spell It Right (20)

Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the s

原创 1022. D進制的A+B (20)

時間限制100 ms內存限制65536 kB代碼長度限制8000 B判題程序Standard作者CHEN, Yue題目描述:輸入兩個非負10進制整數A和B(<=230-1),輸出A+B的D (1 < D <= 10)進制數。輸入格式:輸入