当前位置:网站首页>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;
}
边栏推荐
- Get current JVM data
- Exclusive download! Alibaba cloud native brings 10 + technical experts to bring "new possibilities of cloud native and cloud future"
- Programming language (1)
- ADB related commands
- Runtime. getRuntime(). totalMemory/maxMemory()
- [untitled]
- 股票开户最低佣金炒股开户免费,网上开户安全吗
- 3 environment construction -standalone
- Bufferpool caching mechanism for executing SQL in MySQL
- pycuda._ driver. LogicError: explicit_ context_ dependent failed: invalid device context - no currently
猜你喜欢
Common mode interference of EMC
C deep anatomy - the concept of keywords and variables # dry inventory #
Unity shader visualizer shader graph
[Android reverse] use the DB browser to view and modify the SQLite database (copy the database file from the Android application data directory | use the DB browser tool to view the data block file)
User login function: simple but difficult
SDMU OJ#P19. Stock trading
How to understand the gain bandwidth product operational amplifier gain
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
Opengauss database log management guide
Pyqt5 sensitive word detection tool production, operator's Gospel
随机推荐
Mongoose the table associated with the primary key, and automatically bring out the data of another table
Op amp related - link
Can you draw with turtle?
Leetcode: a single element in an ordered array
QT creator source code learning note 05, how does the menu bar realize plug-in?
Schematic diagram of crystal oscillator clock and PCB Design Guide
C # basic knowledge (1)
Minimum commission for stock account opening. Stock account opening is free. Is online account opening safe
Flutter internationalized Intl
Leetcode week 4: maximum sum of arrays (shape pressing DP bit operation)
How to switch between dual graphics cards of notebook computer
ADB related commands
在恒泰证券开户怎么样?安全吗?
Esp-idf turns off serial port log output.
C summary of knowledge point definitions, summary notes
. Net ADO splicing SQL statement with parameters
FPGA tutorial and Allegro tutorial - link
How can enterprises and developers take advantage of the explosion of cloud native landing?
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
4 environment construction -standalone ha