3070 - 被3或5整除的数
1~100之间所有能被3整除或能被5整除的数
Input
Output
Examples
Input
no input needed
Output
3 5 6 9 10 12 15 18 20 21 24 25 27 30 33 35 36 39 40 42 45 48 50 51 54 55 57 60 63 65 66 69 70 72 75 78 80 81 84 85 87 90 93 95 96 99 100
Solution C++
#include<bits/stdc++.h> using namespace std; int a,b; int main() { for(int i=3;i<=100;i++) { if(i%3==0||i%5==0) { cout<<i<<endl; } } return 0; }