整除整除整除

文章目录


一、题目描述

cpp 复制代码
题目描述
Time Limit: 1000 ms
Memory Limit: 256 mb
输出100到1000之间能被5和6同时整除的数,输出格式为每10个数为一行。

输入输出格式
输入描述:
无输入
输出描述:
按题目意思输出,相邻两个数之间用空格隔开(注意每一行末尾没有空格)
输入输出样例
输入样例#:
输出样例#:
(输出题目答案)

二、参考代码

cpp 复制代码
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

int main()
{
	int cnt = 0;
	for (int i = 100; i < 1000; i++)
	{
		if (i % 5 == 0 && i % 6 == 0)
		{
			cnt++;
			cout << i;
			if (cnt < 10)
			{
				cout << " ";
			}
			if (cnt == 10)
			{
				cout << endl;
				cnt = 0;
			}
		}
	}

	return 0;
}

相关推荐
AC赳赳老秦2 分钟前
OpenClaw+Power Apps 实战:自动生成 Power Apps 应用、连接 Excel 数据源
大数据·开发语言·python·serverless·excel·deepseek·openclaw
提笔了无痕5 分钟前
如何用Go实现整套RAG流程
开发语言·后端·golang
(Charon)7 分钟前
【C++ 面试高频基础:指针、引用、const、static、new/delete 总结】
java·开发语言
一只齐刘海的猫8 分钟前
【Leetcode】找到字符串中所有字母异位词
算法·leetcode·职场和发展
海清河晏11130 分钟前
数据结构 | 八大排序
数据结构·算法·排序算法
2601_9618752442 分钟前
法考考试时间安排及科目|时间表|资料已整理
开发语言·c#·inverted-index·suffix-tree·sstable·r-tree·lsm-tree
AI科技星1 小时前
数术工坊第八卷:算力革命
c语言·开发语言·网络·量子计算·agi
Frank学习路上1 小时前
【C++】面试:关键字与语法特性
c++·面试
geovindu1 小时前
go: Generators Pattern
开发语言·后端·设计模式·golang·生成器模式
IronMurphy2 小时前
【算法五十七】146. LRU 缓存
算法·缓存