1 条题解
-
0
C :
#include<stdio.h> int main(){ int i; for(i = 10;i <= 1000;i++){ if( i % 2 == 0 && i % 3 == 0 && i % 7 == 0){ printf("%d\n",i); } } return 0; }C++ :
#include<iostream> #include<cmath> using namespace std; int main( ){ int i; for(i = 10;i <= 1000;i++){ if(i % 2 == 0 && i % 3 == 0 && i % 7 == 0){ cout<<i<<endl; } } }Pascal :
var i:longint; begin for i:=10 to 1000 do if (i mod 2=0) and (i mod 3=0) and (i mod 7=0) then writeln(i); end.Java :
public class Main { public static void main(String[] args) { for (int x=10; x<=1000; x++) { if(x%2==0&&x%7==0&&x%3==0) System.out.println(x); } } }Python :
for i in range(10, 1001): if i % 2 == 0 and i % 3 == 0 and i % 7 == 0: print(i)
- 1
信息
- ID
- 88
- 时间
- 1000ms
- 内存
- 512MiB
- 难度
- 9
- 标签
- 递交数
- 11
- 已通过
- 5
- 上传者