牛客网PAT练兵场-查验身份证
题解:模拟题,直接算
题目地址:https://www.nowcoder.com/questionTerminal/779a72a420744b1d9c0ec7b7a8dd8f39
/**
*
*作者:Ycute
*时间:2019-11-01-15.37.01
*题解简单描述:直接计算即可
*/ #include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std; int main(){
char ch[];
int t;
scanf("%d",&t);
int flag=;
while(t--){
getchar();
scanf("%s",ch);
long long sum;
sum=(ch[]-'')*+(ch[]-'')*+(ch[]-'')*+(ch[]-'')*+(ch[]-'')*+(ch[]-'')*+(ch[]-'')*+(ch[]-'')*+(ch[]-'')*+(ch[]-'')*+(ch[]-'')*+(ch[]-'')*+(ch[]-'')*+(ch[]-'')*+(ch[]-'')*+(ch[]-'')*+(ch[]-'')*;
sum=sum%;
//cout<<sum<<endl;
switch(sum){
case :{
if(ch[]!=''){
printf("%s\n",ch);
flag=;
}
break;
}
case :{if(ch[]!=''){
printf("%s\n",ch);
flag=;
}
break;
}
case :{if(ch[]!='x'){
printf("%s\n",ch);
flag=;
}
break;
}
case :{if(ch[]!=''){
printf("%s\n",ch);
flag=;
}
break;
}
case :{if(ch[]!=''){
printf("%s\n",ch);
flag=;
}
break;
}
case :{if(ch[]!=''){
printf("%s\n",ch);
flag=;
}
break;
}
case :{if(ch[]!=''){
printf("%s\n",ch);
flag=;
}
break;
}
case :{if(ch[]!=''){
printf("%s\n",ch);
flag=;
}
break;
}
case :{if(ch[]!=''){
printf("%s\n",ch);
flag=;
}
break;
}
case :{if(ch[]!=''){
printf("%s\n",ch);
flag=;
}
break;
}
case :{if(ch[]!=''){
printf("%s\n",ch);
flag=;
}
break;
}
}
}
if(!flag) printf("All passed\n");
return ;
}
牛客网PAT练兵场-查验身份证的更多相关文章
- 牛客网PAT练兵场-科学计数法
题目地址:https://www.nowcoder.com/pat/6/problem/4050 题解:模拟题 /** * Copyright(c) * All rights reserved. * ...
- 牛客网PAT练兵场-旧键盘打字
题目地址:https://www.nowcoder.com/pat/6/problem/4059 题解:用数组下标标记,直接模拟 /** * *作者:Ycute *时间:2019-12-01-21.3 ...
- 牛客网PAT练兵场-人口普查
题目地址:https://www.nowcoder.com/pat/6/problem/4054 题解:结构体排序即可 /** * Copyright(c) * All rights reserved ...
- 牛客网PAT练兵场-完美数列
题目地址:https://www.nowcoder.com/pat/6/problem/4056 题解:先将a数组进行排序,第一次按题意M<=n*p;n=a[0]时,M最大为J(如下图),然后n ...
- 牛客网PAT练兵场-打印沙漏
题目地址:https://www.nowcoder.com/pat/6/problem/4053 题意:模拟题 /** * Copyright(c) * All rights reserved. * ...
- 牛客网PAT练兵场-在霍格沃茨找零钱
题目地址:https://www.nowcoder.com/pat/6/problem/4063 题意:按照题目的进制计算即可 /** * *作者:Ycute *时间:2019-11-14-21.45 ...
- 牛客网PAT练兵场-福尔摩斯的约会
题目地址:https://www.nowcoder.com/pat/6/problem/4040 题意:模拟题,循环找相同的字母,但是注意题目的坑 /** * *作者:Ycute *时间:2019-1 ...
- 牛客网PAT练兵场-A除B
题目地址:https://www.nowcoder.com/pat/6/problem/4043 题解:遍历大数,边除边输出,最后得到余数输出即可 /** * *作者:Ycute *时间:2019-1 ...
- 牛客网PAT练兵场-锤子剪刀布
题目地址:https://www.nowcoder.com/questionTerminal/79db907555c24b15a9c73f7f7d0e2471 题解:无 /** * *作者:Ycute ...
随机推荐
- variable ans might not have been initialized 报错,以及初始化注意点
他是说你没有初始化而已,一般只是个warning,如果是在不能跑,那就给他初始化一下. 注意,初始化可不是任意值哈! 就比如如果要算阶乘,你初始化就不能为0. 还有如果是比较大小这类,就不要把初始化统 ...
- Oracle 忘记密码 如何修改
原文链接:https://jingyan.baidu.com/article/358570f6aaa1efce4724fcdf.html ️打开运行窗口 ️输入sqlplus "/ as s ...
- type 创建类,赋予类\静态方法等
类方法 class ObjectCreator(object): pass @classmethod def testClass(cls): cls.temp = 666 print(cls.temp ...
- pandas_读取Excel并筛选特定数据
# C:\Users\lenovo\Desktop\总结\Python # 读取 Excel 文件并进行筛选 import pandas as pd # 设置列对齐 pd.set_option(&qu ...
- python 连接 mysql 的三种驱动
连接 mysql 驱动 mysq1-client python2,3都能直接使用 对myaq1安装有要求,必须指定位置存在 配置文件 python-mysql python3 不支持 pymysql ...
- PHP time_nanosleep() 函数
实例 延迟执行当前脚本 3,5 秒: <?phpif (time_nanosleep(3,500000000) === true){高佣联盟 www.cgewang.comecho " ...
- LeetCode(1)---检查括号出现的合法性
题目: 检查字符串中"( )","[ ]","{ }" 的合法性,即是否成对出现 eg,如出现"[()]", ...
- 【NOI2017】游戏 题解(2-SAT+缩点)
题目链接 题目大意:有四种场地$a,b,c,x$和三种赛车$A,B,C$,$a$不能跑$A$,$b$不能跑$B$,$c$不能跑$C$,$x$都可以跑.给定$n$个场地和$m$个四元组$(i,h_i,j ...
- spring security 简介+实战
过滤器链: 依赖: security 功能列表: 一.登录验证.权限验证 1.1 httpbasic验证 1.2form验证 建立数据需要遵循RBAC模型 用户表要参考UserDetail创建 实例类 ...
- 004_go语言中的常量
代码演示 package main import "fmt" import "math" const s string = "constant&quo ...