当前位置:网站首页>D23:multiple of 3 or 5 (multiple of 3 or 5, translation + solution)
D23:multiple of 3 or 5 (multiple of 3 or 5, translation + solution)
2022-07-03 23:14:00 【Aggressive Wenwen】
The original title is :OpenJudge - 23:Multiple of 3 Or 5
translate :
describe : seek [1,N] How many integers are 3 or 5 Multiple ;
Input : Not more than one 100000 The positive integer N;
Output : An integer .
Code :
#include<iostream>
using namespace std;
int main()
{
int n,i=1,ans=0;
cin>>n;
for(i=1;i<n;i++)
if(i%5==0||i%3==0) ans++;
cout<<ans;
return 0;
}边栏推荐
- A preliminary study on the middleware of script Downloader
- finalize finalization finally final
- Hcip day 12 notes
- NPM script
- Text replacement demo
- . Net ADO splicing SQL statement with parameters
- Get current JVM data
- File copy method
- 33 restrict the input of qlineedit control (verifier)
- [Android reverse] application data directory (files data directory | lib application built-in so dynamic library directory | databases SQLite3 database directory | cache directory)
猜你喜欢

QT creator source code learning note 05, how does the menu bar realize plug-in?

How to restore the factory settings of HP computer

Weekly leetcode - nc9/nc56/nc89/nc126/nc69/nc120

How to connect a laptop to a projector

The first game of the new year, many bug awards submitted

Firefox set up proxy server

Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?

MLX90614 driver, function introduction and PEC verification

Pointer concept & character pointer & pointer array yyds dry inventory

Hcip day 16 notes
随机推荐
The difference between single power amplifier and dual power amplifier
6.2 normalization 6.2.5 third normal form (3NF)
Maxwell equation and Euler formula - link
X Opencv feature point detection and matching
Why should enterprises do more application activities?
Pan Yueming helps Germany's Rochester Zodiac custom wristwatch
Es6~es12 knowledge sorting and summary
Go error collection | talk about the difference between the value type and pointer type of the method receiver
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
"Learning notes" recursive & recursive
C # basic knowledge (1)
Errors taken 1 Position1 argument but 2 were given in Mockingbird
Subset enumeration method
Unique in China! Alibaba cloud container service enters the Forrester leader quadrant
33 restrict the input of qlineedit control (verifier)
Qtoolbutton available signal
Harbor integrated LDAP authentication
A preliminary study on the middleware of script Downloader
Weekly leetcode - nc9/nc56/nc89/nc126/nc69/nc120
How to prevent malicious crawling of information by one-to-one live broadcast source server