首页/ 题库 / [问答题]编一个程序,输入一个代表身份证号码的字符的答案

编一个程序,输入一个代表身份证号码的字符串,判断字符串长度(18)是否正确,还要判断输入的每个字符是否为数字。否则要求重新输入。

问答题
2022-01-03 06:37
查看答案

正确答案

stringa;
boolq=true;
Console.WriteLine("请输入你的身份证;");
a=Console.ReadLine();
for(intb=0;b<=a.Length-1;b++)
{
if(a[b]>=’0’&&a[b]<=’9’)
{
continue;
}
else
q=false;
}
if(a.Length==18)
{
if(q==true)
Console.WriteLine("输入正确");
elseif(q==false)
Console.WriteLine("输入不合法,请重新输入");
}
else
Console.WriteLine("输入不合法,请重新输入");


试题解析

相关题目
boost的意思是:help or encourage to increase or improve
eloquent的意思是:fluent or persuasive in speaking or writing

A campus emergency ______ occur at any time of the day or night, weekend, or holiday, with little or no warning.

Mainly east 3 or 4 partly cloudy to overcast occasional rain()slowly south moderate or good.
()any case or suspected case of quarantinable disease,or any case of eruptive disease or any death be discovered,the local quarantine officer must be notified immediately.
Should any case or suspected case of quarantinable disease,or any case of eruptive disease or any death be discovered,the local Quarantine Officer must be()immediately.
Masters are()solely responsible for all damages or accidents of whatever kind resulting from the navigating or handling of their vessels by day or by night.
编一个程序,输入一个代表身份证号码的字符串,判断字符串长度(18)是否正确,还要判断输入的每个字符是否为数字。否则要求重新输入。
If he is a common carrier,he is absolutely responsible to the owner of the goods carried ()any loss or damage to them unless caused by an Act of God or the Queen’s enemies,or the inherent vice in the goods themselves,or the negligence of the owner of the goods,or a general average sacrifice.
系统中雷达状态包括Unknown、Operational(or ON)、Failed(or OFF)、Detached。
Owners are to be responsible for loss of or damage to the goods or delay in delivery of the goods only in case the loss,damage or delay has been caused by the improper or negligent stowage of the goods.This means that().
The carrier is liable for loss of or damage to the goods or delay in delivery caused by fire,()the claimant proves that the fire arose from fault or neglect on the part of the carrier,his servants or agents.
执行下列程序段后 MOV AL,87 MOV CL, 4 MOV AH, AL AND AL,0FH OR AL, 30H SHR AH,CL OR AH,30H 则AX=( )H
Shutdown price(or point,or rule) 停业价格(或停业点、停业原则)
写出以下运算符代表信义:AND(),OR()。
翻译:With Average or With Particular Average(WA or WPA)()
阅读下列程序  LOGICAL L1,L2,L3,L4,L5  DATA L1,L2,L3/3*.TRUE./  L4=.NOT.L1.AND..NOT.L2.AND.L3  L5=.NOT.L1.OR..NOT.L2.OR.L3  WRITE(*,*)L4,L5  END  程序运行结果是()
在搜索引擎中输入检索式:“公司OR企业”表示检索结果()
()shall be liable for loss of and damage to the Vessel and/or goods arising or resulting from inaccuracies in stating the description,quantity,weight,measurement or contents.
Every deliberate act of wrongdoing by the master or any of the crew against the ship or cargo,without the authorization or privity of the Shipowner or his agent,is().
广告位招租WX:84302438

免费的网站请分享给朋友吧