1 条题解

  • 0
    @ 2023-3-13 11:07:17

    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;
    		}
    	}
    }
    

    Python :

    for i in range(10, 1001):
        if i % 2 == 0 and i % 3 == 0 and i % 7 == 0:
            print(i)
    
    • 1

    信息

    ID
    1346
    时间
    1000ms
    内存
    16MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者