楼层编号
题目描述
【问题描述】
小林在 NOIP 比赛期间住在“新世界”酒店。和其他酒店不一样的是,这个酒店每天都有一个高能的数字 t,这个数字在楼层中是不会出现的,以 t=3 为例,则 3、13、31、33 等楼层是不存在的,楼层编号为 1,2,4,5,…所以实际上的 4 楼才是 3 楼。
已知小林预订了编号为 m 层的房间,并且当天高能数字是 t,现在他想知道房间所在的真实楼层是多少。
【输入格式】
一行两个整数 m 和 t,1≤m≤100000,0≤t≤9,保证 m 对 t 合法。
【输出格式】
一行一个整数,表示真实楼层。
输入
输出
样例输入
14 3
样例输出
12
提示
#include<iostream> #include<cstdio> #include<cmath> #include<algorithm> #include<string> #include<cstring> using namespace std; int isgo(int x,int t){ while(x){ if(x%10==t) return 1; x=x/10; } return 0; } int main() { int m,t; cin>>m>>t; int ans=0; int s=0; for(int i=1;i<=m;i++) { if(isgo(i,t)) ans++; } cout<<m-ans; return 0; }
VS附加到进程调试
netcore 实现一个简单的Grpc 服务端和客户端
CodeSmith 找不到请求的 .Net Framework Data Provider
ocelot集成consul服务发现
使用ocelot作为api网关
关于add migration 报错的问题解决方案
关于多线程efcore dbcontext 的解决方案。
docker mysql 容器报too many connections 引发的liunx磁盘扩容操作
关于liunx 机器脱机环境(netcore)Nuget包迁移的问题