第一种是取模运算 int qian =input/1000; //千位除以1000 int bai = input/100%10;//百位除以100%10 int shi = input%100/10;//十位%100/10 int ge = input%10;//个位直接%10 System.out.println("千位数"+qian+"百位是"+bai+"十位是"+shi+"个位数是"+ge); 第二种是使用char数组
通常web技术无法设置本地计算机的默认打印机,包括用代码设置纸张大小,如果业务系统中真遇到这种需求,只能通过其它辅助手段(比如ActiveX)实现.下面这段代码,出自网上被广泛使用的"泥人张打印API"(抱歉未找到原始出处),已经用C#封装了很多关于底层打印的API方法 using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; usin