1 条题解

  • 0
    @ 2023-6-11 12:20:40

    C :

    #include<stdio.h>
    int main()
    {
        int x;
        scanf("%d",&x);
        if(x%3==0)
            printf("yes");
        else
            printf("no");
            return 0;
    }
    
    

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int n;
    	cin>>n;
    	if(n%3==0)cout<<"yes"<<endl;
    	else cout<<"no"<<endl;
    	return 0;
    }
    
    

    Java :

    import java.util.Scanner;
    
    public class Main {
    
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    		Scanner sc = new Scanner(System.in);
    		int n = sc.nextInt();
    		if(n % 3 == 0){
    			System.out.println("yes");
    		}else{
    			System.out.println("no");
    		}
    		sc.close();
    	}
    
    }
    

    Python :

    a = int(input())
    if a % 3 == 0:
        print('yes')
    else:
        print('no')
    
    • 1

    信息

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