1 solutions

  • 0
    @ 2025-3-3 16:28:35

    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

    Information

    ID
    10200
    Time
    1000ms
    Memory
    16MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By