YTU 2797: 复仇者联盟之关灯
2024-08-31 02:28:10
2797: 复仇者联盟之关灯
时间限制: 1 Sec 内存限制: 128 MB
提交: 563 解决: 160
题目描述
输入n(1~500)盏灯并编号,输入1~9(包含1和9)的数字m,灭掉编号中带m的数及m倍数的灯,最后输出亮出的灯的编号。
输入
灯数n,数字m
输出
剩下的亮的灯的编号(每个编号占一行)
样例输入
30 3
样例输出
1
2
4
5
7
8
10
11
14
16
17
19
20
22
25
26
28
29
你 离 开 了 , 我 的 世 界 里 只 剩 下 雨 。 。 。
#include <stdio.h>
#include <stdlib.h>
int main()
{
int wei(int,int);
int a,b,i;
scanf("%d%d",&a,&b);
for(i=1; i<a; i++)
{
if(i%b==0||wei(i,b)==0)continue;
printf("%d\n",i);
}
return 0;
}
int wei(int a,int b)
{
while(a)
{
if(a%10==b)return 0;
a/=10;
}
return 1;
}
最新文章
- Redis配置文件redis.conf
- redis sentinel 配置
- winPcap_1_开篇
- BackgroundWorker 后台进程控制窗体label、richtextbook内容刷新
- Java数据类型(基本数据类型)学习
- !终端伪装测试之fuck校园网
- Spring Kafka和Spring Boot整合实现消息发送与消费简单案例
- 你觉得 .NET 性能低,可能只是因为你的能力低
- 加密算法之非对称加密RSA
- docker for windows 10 添加阿里云镜像仓库无效问题
- ibatis.net:尽可能的使用匿名类型替换 Hashtable
- python profile性能分析
- initctl 创建自己的JOB
- 垃圾收集简介 - GC参考手册
- 查看oracle 11g数据库用户的密码是否区分大小写
- vmware虚拟机下linux centos6.6只有lo,没有eth0网卡、随机分配ip地址,固定ip地址等问题
- Linux&;nbsp;2.6.32内核字符设备驱…
- oracle数据库单表查询
- 使用vsftp搭建ftp服务
- Tomcat 连接池调优
热门文章
- Python的伪造数据库:Faker
- webstom2017最新破解 ------------ http://blog.csdn.net/voke_/article/details/76418116
- docker在ubuntu16.04下的安装及阿里云镜像的配置
- 09C语言指针
- 51nod 1083 矩阵取数问题【动态规划】
- linux常用操作记录
- xfce 设在分辨率1920 1080
- Python随笔day02
- STM32F103移值FreeRtos笔记
- 【模板】51nod 1006 最长公共子序列Lcs