标签:print 输入 can author port out sum stat rgs
import java.util.Scanner; /** * @author 蓝色以太 * 幸运抽奖 */ public class LuckyDraw { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("请输入4位会员卡号:"); int num=sc.nextInt(); int ge=num%10; int shi=num%100/10; int bai=num/100%10; int qian=num/1000; int sum=ge+shi+bai+qian; System.out.println("会员卡号"+num+"各位之和:"+sum); } }
标签:print 输入 can author port out sum stat rgs
原文地址:http://www.cnblogs.com/lanseyitai1224/p/7011437.html