无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(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)的評論 (共 條)

分享到微博請遵守國家法律
旬阳县| 伊吾县| 鲁山县| 紫云| 如东县| 南部县| 双鸭山市| 萍乡市| 巴里| 梅州市| 怀化市| 鸡泽县| 汕尾市| 浏阳市| 芷江| 巴楚县| 南陵县| 宝鸡市| 萝北县| 无棣县| 重庆市| 教育| 太和县| 灵山县| 宜黄县| 治县。| 建德市| 义马市| 唐河县| 南平市| 漳平市| 安阳市| 阿城市| 连云港市| 鹤岗市| 平江县| 万安县| 明水县| 修武县| 五河县| 鹤山市|