当前位置:网站首页>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;
}边栏推荐
- Fluent learning (4) listview
- Harbor integrated LDAP authentication
- The overseas listing of Shangmei group received feedback, and brands such as Han Shu and Yiye have been notified for many times and received attention
- Leetcode: a single element in an ordered array
- ThreadLocal function, scene and principle
- How can I get the Commission discount of stock trading account opening? Is it safe to open an account online
- Op amp related - link
- Schematic diagram of crystal oscillator clock and PCB Design Guide
- Format cluster and start cluster
- [untitled]
猜你喜欢

Programming language (1)

In 2022, 6G development has indeed warmed up

Teach you to easily learn the type of data stored in the database (a must see for getting started with the database)

2022.02.13

"Learning notes" recursive & recursive

Pointer concept & character pointer & pointer array yyds dry inventory

Apple released a supplementary update to MacOS Catalina 10.15.5, which mainly fixes security vulnerabilities

Pyqt5 sensitive word detection tool production, operator's Gospel

2 spark environment setup local

Cgb2201 preparatory class evening self-study and lecture content
随机推荐
FPGA tutorial and Allegro tutorial - link
2 spark environment setup local
Es6~es12 knowledge sorting and summary
X Opencv feature point detection and matching
Why should enterprises do more application activities?
Programming language (2)
2/14 (regular expression, sed streaming editor)
Fluent learning (5) GridView
[note] IPC traditional interprocess communication and binder interprocess communication principle
Can you draw with turtle?
2022.02.13
Pointer concept & character pointer & pointer array yyds dry inventory
Take you to master the formatter of visual studio code
string
Pyqt5 sensitive word detection tool production, operator's Gospel
Text replacement demo
Yyds dry goods inventory Prometheus alarm Art
Get current JVM data
Overview of Yunxi database executor
Leetcode: a single element in an ordered array