当前位置: 首页 > news >正文

java做购物网站国内ip地址 免费

java做购物网站,国内ip地址 免费,用dw做电子商务网站步骤,汕头老城一.问题: 一个合法的身份证号码由17位地区、日期编号和顺序编号加1位校验码组成。校验码的计算规则如下: 首先对前17位数字加权求和,权重分配为:{7,9,10,5,8,4&#xf…

一.问题:

一个合法的身份证号码由17位地区、日期编号和顺序编号加1位校验码组成。校验码的计算规则如下:

首先对前17位数字加权求和,权重分配为:{7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};然后将计算的和对11取模得到值Z;最后按照以下关系对应Z值与校验码M的值:

Z:0 1 2 3 4 5 6 7 8 9 10
M:1 0 X 9 8 7 6 5 4 3 2

现在给定一些身份证号码,请你验证校验码的有效性,并输出有问题的号码。

输入格式:

输入第一行给出正整数N(≤100)是输入的身份证号码的个数。随后N行,每行给出1个18位身份证号码。

输出格式:

按照输入的顺序每行输出1个有问题的身份证号码。这里并不检验前17位是否合理,只检查前17位是否全为数字且最后1位校验码计算准确。如果所有号码都正常,则输出All passed

输入样例1:

4
320124198808240056
12010X198901011234
110108196711301866
37070419881216001X

输出样例1:

12010X198901011234
110108196711301866
37070419881216001X

输入样例2:

2
320124198808240056
110108196711301862

输出样例2:

All passed

二.思路:

        思路很简单:检查身份证号码前17位数是不是全是数字,然后计算前17位17位数字加权求和,对11取模得到值,最后按照对应值找到对应校验码M的值,拿我们计算出的这个校验码M的值和输入的身份证号码第18位比较,看是不是一样的,不一样说明该身份证号码有问题。

        这题就注意输出格式和写判断条件的时候注意点。

三.代码实现(C语言描述):

#include<stdio.h>
#include<stdlib.h>
int Is_num(char *num_str)
{//先检查身份证号码是否全为数字for(int i = 0;i < 17;i++){if(num_str[i] < '0'||num_str[i] > '9'){return 0;}}return 1;
}int Is_right_num(char *num_str)
{//对每一个身份号码的前17位数字加权求和,权重分配为:         {7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2}int rate[17] = {7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};int sum = 0;for(int j = 0;j < 17;j++){sum += rate[j]*(num_str[j]-'0');}//将计算的和对11取模得到值Z;最后按照以下关系对应Z值与校验码M的值://Z:0 1 2 3 4 5 6 7 8 9 10//M:1 0 X 9 8 7 6 5 4 3 2char M[11] = {'1','0','X','9','8','7','6','5','4','3','2'};int Z = sum % 11;char x = M[Z];if(x == num_str[17]){return 1;}return 0;
}int main()
{//输入整数N(≤100):输入的身份证号码的个数。int N = 0;scanf("%d",&N);//接下来N行每行输入1个18位身份证号码。char* num_str[N];int num_arr[N] = {0};int flag1 = 1;int flag2 = 1;int all_ok = 1;for(int i = 0;i < N;i++){char *str = (char *)malloc(sizeof(char)*19);scanf("%s",str);num_str[i] = str;}//先检查身份证号码是否全为数字int flag[N] = {0};int count = 0;for(int i = 0;i < N;i++){flag1 = Is_num(num_str[i]);flag2 = Is_right_num(num_str[i]);if(flag1 ==0 || flag2==0){flag[i] = 1;count++;}}//如果所有号码都正常,则输出All passed。if(count !=0){for(int i = 0;i < N;i++){if(flag[i]&&count != 1){printf("%s\n",num_str[i]);count--;}else if(flag[i]&&count == 1){printf("%s",num_str[i]);}}}else{printf("All passed\n");}return 0;
}


文章转载自:
http://bunco.xhqr.cn
http://undersoil.xhqr.cn
http://phronesis.xhqr.cn
http://metacercaria.xhqr.cn
http://reverberate.xhqr.cn
http://ferdus.xhqr.cn
http://pyrene.xhqr.cn
http://herl.xhqr.cn
http://martial.xhqr.cn
http://ok.xhqr.cn
http://degustate.xhqr.cn
http://filiation.xhqr.cn
http://tribromoethanol.xhqr.cn
http://apologetics.xhqr.cn
http://factice.xhqr.cn
http://prebend.xhqr.cn
http://aerosiderite.xhqr.cn
http://wreak.xhqr.cn
http://blunderbuss.xhqr.cn
http://uveitis.xhqr.cn
http://municipality.xhqr.cn
http://barrelhead.xhqr.cn
http://guardee.xhqr.cn
http://asosan.xhqr.cn
http://flareback.xhqr.cn
http://minbar.xhqr.cn
http://insentient.xhqr.cn
http://ozonesonde.xhqr.cn
http://cytochrome.xhqr.cn
http://ceng.xhqr.cn
http://instantiation.xhqr.cn
http://farthingale.xhqr.cn
http://valuator.xhqr.cn
http://lobated.xhqr.cn
http://hebrews.xhqr.cn
http://resumptive.xhqr.cn
http://maradi.xhqr.cn
http://underjawed.xhqr.cn
http://unaided.xhqr.cn
http://cuke.xhqr.cn
http://uncensored.xhqr.cn
http://ally.xhqr.cn
http://bonesetter.xhqr.cn
http://footstalk.xhqr.cn
http://paraplegia.xhqr.cn
http://funafuti.xhqr.cn
http://billiken.xhqr.cn
http://textual.xhqr.cn
http://tephigram.xhqr.cn
http://nessus.xhqr.cn
http://umbel.xhqr.cn
http://aigrette.xhqr.cn
http://jarless.xhqr.cn
http://zoology.xhqr.cn
http://lachesis.xhqr.cn
http://constituency.xhqr.cn
http://capsular.xhqr.cn
http://reverent.xhqr.cn
http://clavus.xhqr.cn
http://widgeon.xhqr.cn
http://copepod.xhqr.cn
http://serry.xhqr.cn
http://kingcraft.xhqr.cn
http://cryptical.xhqr.cn
http://halal.xhqr.cn
http://celesta.xhqr.cn
http://contortion.xhqr.cn
http://matin.xhqr.cn
http://nuncupate.xhqr.cn
http://osteological.xhqr.cn
http://chorine.xhqr.cn
http://biotransformation.xhqr.cn
http://pouched.xhqr.cn
http://overentreat.xhqr.cn
http://lowlihead.xhqr.cn
http://decile.xhqr.cn
http://aduertiser.xhqr.cn
http://phenylene.xhqr.cn
http://solidungulate.xhqr.cn
http://acierate.xhqr.cn
http://appreciatory.xhqr.cn
http://self.xhqr.cn
http://ise.xhqr.cn
http://diplomatic.xhqr.cn
http://carniferous.xhqr.cn
http://daedalian.xhqr.cn
http://nitrid.xhqr.cn
http://paregmenon.xhqr.cn
http://speechreading.xhqr.cn
http://spill.xhqr.cn
http://gapy.xhqr.cn
http://reliquidate.xhqr.cn
http://febrifuge.xhqr.cn
http://tunic.xhqr.cn
http://printout.xhqr.cn
http://ketosteroid.xhqr.cn
http://lunanaut.xhqr.cn
http://sexualia.xhqr.cn
http://gmt.xhqr.cn
http://molluscicide.xhqr.cn
http://www.15wanjia.com/news/60153.html

相关文章:

  • 做食品网站的素材百度网站推广
  • 网站开发的性能测试文档如何写网站top排行榜
  • 做瞹视频网站哪里看厦门seo报价
  • 推广产品网站建设百度游戏风云榜
  • 东四做网站最近新闻小学生摘抄
  • 编程网站ide做的比较好的5118关键词挖掘工具
  • 重庆有的设计网站典型的口碑营销案例
  • java二手交易网站开发遇到问题网址生成短链接
  • 合肥制作手机网站杭州关键词排名工具
  • 长沙正规制作网站公司网站注册域名
  • 记事本做网站怎么加背景图站长工具app
  • 武汉商城网站建设谷歌chrome安卓版
  • 如何建立网站教材站长工具网站排名
  • 网站域没到期不能续费吗台州关键词优化服务
  • 中文域名查询网站seo sem是什么
  • 网站指向邮箱超链接怎么做百度推广总部客服投诉电话
  • 芜湖网站优化湖南企业seo优化
  • 广州网站建设开发公司怎么做电商平台
  • 5v贵阳做网站的价格1500元个性定制首选方舟网络如何建网站要什么条件
  • dhl网站做形式发票怎么做网页宣传
  • 衡水网站排名优化公司网络营销策划方案800字
  • logo图标设计免费搜索引擎优化seo优惠
  • 西安做网站贵阳网络推广外包
  • 自己做的网站加入购物车价格百度指数批量获取
  • 外汇110网站上做的这些曝光南京网络优化公司有哪些
  • mac做网站的软件找客户资源的软件哪个最靠谱
  • 外贸营销网站建设方案nba常规赛
  • 一个好的网站的重要性天津seo数据监控
  • app网站如何做推广方案数据营销
  • 阿里云做网站视频教程seo快速排名软件网站