1 条题解

  • 0
    @ 2022-12-9 0:58:44

    C :

    #include<stdio.h>
    void main()
    {
    int i=1;
    while(i<=500){
    
    if (i%3==2&&i%5==3&&i%7==2){
    printf("%d\n",i);
    }
    i++;
    }
    
    
    
    
    
    	
    }	
    

    C++ :

    #include <iostream>
    #include <iomanip>
    using namespace std;
    
    int main(){
        int i;
        for(i=1;i<=500;i++){
        	if(i%3==2&&i%5==3&&i%7==2){
        		cout<<i<<endl;
    		}
    	}
    }
    

    Python :

    for i in range(1,500):
        if i % 3 == 2 and i % 5 == 3 and i % 7 == 2:
            print(i)
    
    
    • 1

    信息

    ID
    57
    时间
    1000ms
    内存
    16MiB
    难度
    0.4
    标签
    递交数
    59
    已通过
    34
    上传者