【水题】CodeForces
来源:互联网 发布:网络小说作家 知乎 编辑:程序博客网 时间:2024/05/17 00:12
Problem Description
输入k,l,m,n,d。d代表dragon的数量。不满足k,l,m,n倍数的恐龙不能消除。让你求最多能消除几只龙
代码:
#include<bits/stdc++.h>using namespace std;int main(){ int a, b, c, d; while(~scanf("%d %d %d %d", &a, &b, &c, &d)) { int Max; scanf("%d", &Max); int num = 0; for(int i = 1; i <= Max; i++)//遍历一遍 { if(i % a != 0 && i % b != 0 && i % c != 0 && i % d != 0) num++;//不能消除的数量 } printf("%d\n", Max - num); } return 0;}
阅读全文
0 0
- CodeForces水题
- 【水题】CodeForces
- 【水题】CodeForces
- Codeforces Gym100286I iSharp (水题)
- CodeForces 483B(水题)
- codeforces 617B 水题~
- 水题CodeForces 120C
- codeforces 676A (水题)
- codeforces 685A (水题)
- codeforces 589I(水题)
- Codeforces Divisibility【水题】
- codeforces 691B 水题
- codeforces 733D (水题)
- CodeForces 59AWord 水题
- CodeForces 352B 水题
- codeforces~~~
- Codeforces
- codeforces
- 【代码笔记】iOS-Transition动画
- python爬虫系列教程,静谧
- C# 发送POST请求
- 游戏制作流程思考
- 形参、实参;
- 【水题】CodeForces
- Centos/Linux 下升级GCC G++
- 2.临界段代码学习
- C语言中调试用到的宏定义
- Dos-端口占用
- 初学Android——装备选择
- button点击无动作触发
- SublimeText作为Python的开发工具配置,Python3 安装bulitwith 和urllib2包
- apache2 linux 配置端口映射相应目录