当前位置:网站首页>【入门】提取不重复的整数
【入门】提取不重复的整数
2022-07-01 07:55:00 【-天道酬勤-】
描述
输入一个 int 型整数,按照从右向左的阅读顺序,返回一个不含重复数字的新的整数。保证输入的整数最后一位不是 0 。
输入描述
输入一个int型整数
输出描述
按照从右向左的阅读顺序,返回一个不含重复数字的新的整数
示例1
输入:9876673
输出:37689
<?php
fscanf(STDIN, "%d", $a);
// 转为字符串
$a .= "";
// 结果字符串
$res = '';
// 字符串长度
$len = strlen($a);
for ($i = $len - 1; $i > -1; $i--) {
if (strpos($res, $a[$i]) !== false) {
continue;
}
$res .= $a[$i];
}
echo $res;

边栏推荐
- STM32 uses esp01s to go to the cloud, mqtt FX debugging
- AUTOSAR learning record (1) – ECUM_ Init
- 浅谈CVPR2022的几个研究热点
- Eigen矩阵运算库快速上手
- How to use layui to display the data in the database in the form of tables
- [software] phantomjs screenshot
- 奥迪AUDI EDI 项目中供应商需要了解哪些信息?
- How to make the two financial transactions faster
- 十大劵商如何开户?另外,手机开户安全么?
- [batch dos-cmd command - summary and summary] - Common operators in the CMD window (<, < <, & <,>, > >, & >, & >, & &, ||, (),;, @)
猜你喜欢

Access报表实现小计功能

redisson使用全解——redisson官方文檔+注釋(上篇)

Custom events of components ①

2022广东省安全员A证第三批(主要负责人)特种作业证考试题库模拟考试平台操作

STM32 uses esp01s to go to the cloud, mqtt FX debugging
![[MySQL learning notes 25] SQL statement optimization](/img/01/cf0556961670bb43512caab8d5f4e5.png)
[MySQL learning notes 25] SQL statement optimization
![[recommendation system] breakthrough and imagination of deep location interactive network dpin for meituan takeout recommendation scenario](/img/10/ed857892d2e0ea72e100a4008e6d69.png)
[recommendation system] breakthrough and imagination of deep location interactive network dpin for meituan takeout recommendation scenario

Why some people earn nearly 10billion a year, while others earn 3000 a month: the details you ignore actually make the most money
![[website architecture] solve 90% of distributed transactions in one move, and introduce the working principles and application scenarios of database transactions and distributed transactions](/img/2c/07d729d49b1d74553decac4588074e.png)
[website architecture] solve 90% of distributed transactions in one move, and introduce the working principles and application scenarios of database transactions and distributed transactions

Gdip - hatchBrush图案表
随机推荐
[R language] two /n data merge functions
PHP laravel wechat payment
Discussion on several research hotspots of cvpr2022
Cyclic neural network
How to use layui to display the data in the database in the form of tables
源代码加密的意义和措施
她就是那个「别人家的HR」|ONES 人物
【批处理DOS-CMD命令-汇总和小结】-Cmd窗口中常用操作符(<、<<、&<、>、>>、&>、&、&&、||、|、()、;、@)
2022 mobile crane driver test exercises and online simulation test
2022 operation of refrigeration and air conditioning equipment operation of national question bank simulated examination platform
Teach you how to apply for domestic trademark online step by step
base64
QT -- 1. QT connection database
SharePoint - how to quickly check whether SharePoint is standard or enterprise edition?
[MySQL learning notes 25] SQL statement optimization
redisson使用全解——redisson官方文檔+注釋(上篇)
AArdio - 【问题】bass库回调时内存增长的问题
论文学习——水文时间序列相似性查询的分析与研究
Browser local storage
【无标题】