第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

麻煩各位大佬幫我看看這里哪里出錯(cuò)了,運(yùn)行完會(huì)報(bào)錯(cuò)

using System;

using System.Text.RegularExpressions;


namespace _1901203021_廖海鵬

{

? ? class Program

? ? {

? ? ? ? static void Main(string[] args)

? ? ? ? {

? ? ? ? ? ? Console.Write("身份證號(hào)碼:");

? ? ? ? ? ? string id = Convert.ToString(Console.ReadLine());

? ? ? ? ? ? string expression = @"^d{18}$";

? ? ? ? ? ? if (Regex.IsMatch(id, expression) == false)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? Console.Write(false);

? ? ? ? ? ? }

? ? ? ? ? ? int[] wi = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 };

? ? ? ? ? ? char[] checkNum = { '1', '0', 'x', '9', '8', '7', '6', '5', '4', '3', '2' };

? ? ? ? ? ? //while (System.Text.Encoding.Default.GetByteCount(id) != 18)

? ? ? ? ? ? //{

? ? ? ? ? ? //? ? Console.WriteLine("身份證輸入錯(cuò)誤,請(qǐng)重新輸入");

? ? ? ? ? ? //? ? id = Convert.ToString(Console.ReadLine());

? ? ? ? ? ? //}

? ? ? ? ? ? //char[] ID = id.ToCharArray();

? ? ? ? ? ? int[] ID = new int[id.Length];

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

? ? ? ? ? ? {

? ? ? ? ? ? ? ? int ii = Convert.ToInt32(id[i]);

? ? ? ? ? ? ? ? ID[i] = ii;

? ? ? ? ? ? }

? ? ? ? ? ? int S = 0;

? ? ? ? ? ? for (int x = 0; x < 17; x++)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? int Ai = ID[x];//將ID聲明為int

? ? ? ? ? ? ? ? int Wi = wi[x];

? ? ? ? ? ? ? ? S += Ai * Wi;

? ? ? ? ? ? }

? ? ? ? ? ? int Y = S % 11;

? ? ? ? ? ? Y = Convert.ToInt32(checkNum[Y]);

? ? ? ? ? ? if (ID[18] == Y)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? Console.WriteLine("校驗(yàn)成功,此身份證號(hào)為真");

? ? ? ? ? ? }

? ? ? ? ? ? else

? ? ? ? ? ? {

? ? ? ? ? ? ? ? Console.WriteLine("校驗(yàn)失敗,此身份證號(hào)為假");

? ? ? ? ? ? }




? ? ? ? }

? ? ? ? }

? ? }


正在回答

3 回答

你這寫(xiě)的是什么鬼?????

0 回復(fù) 有任何疑惑可以回復(fù)我~

剛剛發(fā)錯(cuò)了,是這個(gè),為什么會(huì)跳出錯(cuò)誤?

0 回復(fù) 有任何疑惑可以回復(fù)我~

? ? ? ? static void Main(string[] args)

? ? ? ? {

? ? ? ? ? ? Console.Write("身份證號(hào)碼:");

? ? ? ? ? ? string id = Convert.ToString(Console.ReadLine());

? ? ? ? ? ? string expression = @"^d{18}$";

? ? ? ? ? ? if (Regex.IsMatch(id, expression) == false)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? Console.Write(false);

? ? ? ? ? ? }

? ? ? ? ? ? int[] wi = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 };

? ? ? ? ? ? char[] checkNum = { '1', '0', 'x', '9', '8', '7', '6', '5', '4', '3', '2' };

? ? ? ? ? ? //while (System.Text.Encoding.Default.GetByteCount(id) != 18)

? ? ? ? ? ? //{

? ? ? ? ? ? //? ? Console.WriteLine("身份證輸入錯(cuò)誤,請(qǐng)重新輸入");

? ? ? ? ? ? //? ? id = Convert.ToString(Console.ReadLine());

? ? ? ? ? ? //}

? ? ? ? ? ? char[] _id = id.ToCharArray();

? ? ? ? ? ? int[] ID = new int[_id.Length];

? ? ? ? ? ? for (int i = 0; i < _id.Length; i++)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? int ii = Convert.ToInt32(_id[i]);

? ? ? ? ? ? ? ? ID[i] = ii;

? ? ? ? ? ? }

? ? ? ? ? ? int S = 0;

? ? ? ? ? ? for (int x = 0; x < 17; x++)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? int Ai = ID[x];

? ? ? ? ? ? ? ? int Wi = wi[x];

? ? ? ? ? ? ? ? S += Ai * Wi;

? ? ? ? ? ? }

? ? ? ? ? ? int Y = S % 11;

? ? ? ? ? ? char z = Convert.ToChar(Y);

? ? ? ? ? ? z = checkNum[Y];

? ? ? ? ? ? if (ID[18] == z)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? Console.WriteLine("校驗(yàn)成功,此身份證號(hào)為真");

? ? ? ? ? ? }

? ? ? ? ? ? else

? ? ? ? ? ? {

? ? ? ? ? ? ? ? Console.WriteLine("校驗(yàn)失敗,此身份證號(hào)為假");

? ? ? ? ? ? }

? ? ? ? }


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

麻煩各位大佬幫我看看這里哪里出錯(cuò)了,運(yùn)行完會(huì)報(bào)錯(cuò)

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)