国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

作業(yè)代碼(非最優(yōu)

2019-11-04 04:03 作者:kands-code  | 我要投稿

import java.util.*;


public class njava06{

? public static void main(String[]args){

? ? //get imformation;

? ? System.out.println("Please enter your id :");

? ? Scanner in = new Scanner(System.in);

? ? String id = in.nextLine();

? ? int[] arr = new int[18];

? ? for (int i = 0;i < id.length();i++){

? ? ? String cup = String.valueOf(id.charAt(i));

? ? ? int num = Integer.parseInt(cup);

? ? ? arr[i] = num;

? ? }

? ? //computer the imformation;

? ? int year = 1000*arr[6]+100*arr[7]+10*arr[8]+arr[9];

? ? int month = 10*arr[10]+arr[11];

? ? int day = 10*arr[12]+arr[13];

? ? System.out.println("Please enter the year :");

? ? int nowYear = in.nextInt();

? ? System.out.println("Please enter the month :");

? ? int nowMonth = in.nextInt();

? ? System.out.println("Please enter the day :");

? ? int nowDay = in.nextInt();

? ? System.out.println("You born on "+year+"/"+month+"/"+day);

? ? //make a choice and print out;

? ? if(nowMonth == month){

? ? ? if(nowDay >= day){

? ? ? ? int age = nowYear - year;

? ? ? ? System.out.println("You are "+age+"years old.");

? ? ? }

? ? ? else{

? ? ? ? int age = nowYear - year -1;

? ? ? ? System.out.println("You are "+age+"years old.");

? ? ? }

? ? }

? ? else if(nowMonth > month){

? ? ? int age = nowYear - year;

? ? ? System.out.println("You are "+age+"years old.");

? ? }

? ? else{

? ? ? int age = nowYear - year -1;

? ? ? System.out.println("You are "+age+"years old.");

? ? }

? ? if(arr[16]%2 == 0){

? ? ? System.out.println("You are female");

? ? }

? ? else{

? ? ? System.out.println("You are male");

? ? }

? ? //get the code of imformation;

? ? int point = 0;

? ? for(int i = 0;i < id.length();i++){

? ? ? int b = arr[i]*((int)(java.lang.Math.pow(2,i))%11);

? ? ? point += b;

? ? }

? ? int codeInf = point%11;

? ? System.out.print("The code imformation is ");

? ? if(codeInf == 0){

? ? ? System.out.print(1);

? ? }

? ? else if(codeInf == 1){

? ? ? System.out.print(0);?

? ? }

? ? else if(codeInf == 2){

? ? ? System.out.print('X');

? ? }

? ? else{

? ? ? System.out.print(12-codeInf);?

? ? }

? }

}


作業(yè)代碼(非最優(yōu)的評論 (共 條)

分享到微博請遵守國家法律
龙里县| 方山县| 桦南县| 腾冲县| 胶州市| 衡阳市| 汤阴县| 繁峙县| 杭锦后旗| 抚松县| 彭山县| 神池县| 新平| 米易县| 金华市| 曲水县| 淮安市| 同仁县| 乌兰浩特市| 河西区| 基隆市| 年辖:市辖区| 金昌市| 秦安县| 信阳市| 香河县| 中方县| 浮山县| 蒲江县| 尉犁县| 淮北市| 开原市| 潮州市| 新乐市| 嘉善县| 罗田县| 盐城市| 武邑县| 平阴县| 久治县| 曲麻莱县|