- 博客(10)
- 收藏
- 关注
转载 使用IDEA创建静态项目
1.创建static web模块2.项目名,保存位置3.创建HTML文件,选择HTML5版本4.点击右上角一排浏览器按钮运行,idea会使用内置的服务器在指定的浏览器上运行。端口号是随机指定的。5.访问地址...
2020-02-12 16:11:58
1861
原创 java.lang.Integer
java.lang.Number|- java.lang.IntegerInteger.MIN_VALUE----获取int最大值Integer.toBinartString(a)//十->二 toOctalString八 toHoxString十六Integer.toString( 60,2);转化为二进制其他进制转Integer.parseInt(“110”, 10) ...
2020-02-11 16:41:22
206
原创 java.math.BigDecimal;大小数运算
java.math.BigInteger;大整数// 创建大数据BigDecimal i = new BigDecimal(10);BigDecimal j = new BigDecimal(10);// 做加法运算BigDecimal sum = i.add(j);System.out.println(sum); ...
2020-02-11 16:37:34
156
原创 java.text.DecimalFormat;数字格式化
#任意数字,千分位.小数点0不够补0DecimalFormat df = new DecimalFormat("###,###");System.out.println(df.format(1234567));//1,234,567 //加入千分位,保留2位小数DecimalFormat df2 = new DecimalFormat("###,###.##");System....
2020-02-11 16:36:52
469
原创 使用StringBuffer,将十进制数转化为二进制数
不用堆栈来进制转化,而是将每次得到的数存放于StringBuffer中,直至原数为0结束循环 int i = 4; StringBuffer s = new StringBuffer(); while (i != 0) { s.append((i % 2)); i = i / 2; } System.out.println(s.reverse());...
2020-02-11 15:31:53
408
原创 System.getProperties()
//获取系统的属性信息,并存储到了Properties集合中。 properties集合中存储String类型的键和值。//最好使用它自己的存储和取出的方法来完成元素的操作。Properties prop = System.getProperties();Set<String> nameSet = prop.stringPropertyNames();for(String na...
2020-02-11 13:56:21
145
原创 C语言 如何在一个文件中调用另一个文件的函数 用头文件
test.h#include <stdio.h>int func(int x);func.cint func(int x){ return x*x ; //返回x的平方}main.c#include "test.h"void main(){ int a=3; printf("%d\n", func(a) ); //调用func.c中的函数...
2020-02-04 17:13:11
4753
原创 C语言 字符串的输入-输出
C语言中没有字符串类型,而是用字符数组**char a[][]**代替单字符%c 字符串%s法一 :用scanf输入字符串,printf输出字符串 char ch[5]; for (int i = 0; i < 5; i++) { scanf("%c", &ch[i]); } for (int i = 0; i < 5; i++) { prin...
2019-12-31 15:29:42
618
原创 pycharm --file and code templates
进入File->settings->框内搜索File and Code Templates->Python Script其中的模板为#encoding:utf-8#!/usr/bin/env python"""@version: python2.7@author: ‘$USER‘@license: Apache Licence @contact: 12234...
2018-09-28 15:01:14
2938
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人