当前位置:网站首页>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;
}边栏推荐
- Design of logic level conversion in high speed circuit
- How to restore the factory settings of HP computer
- Bufferpool caching mechanism for executing SQL in MySQL
- How to prevent malicious crawling of information by one-to-one live broadcast source server
- Schematic diagram of crystal oscillator clock and PCB Design Guide
- Hcip day 14 notes
- ADB related commands
- [Happy Valentine's day] "I still like you very much, like sin ² a+cos ² A consistent "(white code in the attached table)
- Hcip 13th day notes
- Sword finger offer day 4 (Sword finger offer 03. duplicate numbers in the array, sword finger offer 53 - I. find the number I in the sorted array, and the missing numbers in sword finger offer 53 - ii
猜你喜欢

How to switch between dual graphics cards of notebook computer
![[Android reverse] use DB browser to view and modify SQLite database (download DB browser installation package | install DB browser tool)](/img/1d/044e81258db86cf34eddd3b8f5cf90.jpg)
[Android reverse] use DB browser to view and modify SQLite database (download DB browser installation package | install DB browser tool)

Overview of Yunxi database executor

Ppt image processing

Hcip day 12 notes

Learning notes of raspberry pie 4B - IO communication (SPI)

Hcip day 15 notes

Qtoolbutton - menu and popup mode
![[network security] what is emergency response? What indicators should you pay attention to in emergency response?](/img/ff/c733ffbb922760910ab09af3ae2886.jpg)
[network security] what is emergency response? What indicators should you pay attention to in emergency response?
![[Android reverse] application data directory (files data directory | lib application built-in so dynamic library directory | databases SQLite3 database directory | cache directory)](/img/b8/e2a59772d009b6ee262fb4807f2cd2.jpg)
[Android reverse] application data directory (files data directory | lib application built-in so dynamic library directory | databases SQLite3 database directory | cache directory)
随机推荐
Creation of the template of the password management software keepassdx
string
How to switch between dual graphics cards of notebook computer
pycuda._ driver. LogicError: explicit_ context_ dependent failed: invalid device context - no currently
Label coco format data and format data in the upper left corner and lower right corner are mutually converted
To rotate 90 degrees clockwise and modify the video format
IO flow review
Go Technology Daily (2022-02-13) - Summary of experience in database storage selection
Esp-idf turns off serial port log output.
In VS_ In 2019, scanf and other functions are used to prompt the error of unsafe functions
540. Single element in ordered array
How to prevent malicious crawling of information by one-to-one live broadcast source server
Schematic diagram of crystal oscillator clock and PCB Design Guide
Programming language (2)
2 spark environment setup local
webAssembly
How about agricultural futures?
Overview of Yunxi database executor
Yyds dry goods inventory [practical] simply encapsulate JS cycle with FP idea~
QT creator source code learning note 05, how does the menu bar realize plug-in?