1 条题解

  • 0
    @ 2025-10-10 15:45:26

    C :

    #include<stdio.h>
    int main(){
    	int x;
    	scanf("%d",&x);
    	if(x%2==0){
    		printf("%s","y e s");
    	}else{
    		printf("%s","n o");
    	}
    	return 0;
    } 
    

    C++ :

    #include<iostream>
    using namespace std;
    int main(){
    	int x;
    	cin>>x;
    	if(x%2==0){
    		cout<<"y e s"<<endl;
    	}else{
    		cout<<"n o"<<endl;
    	}
    }
    
    	
    
    

    Pascal :

    var n:longint;
    begin
      read(n);
      if n mod 2=0 then writeln('y e s')
       else writeln('n o');
    end.
    

    Java :

    import java.util.Scanner;
    
    public class Main {
    
    	public static void main(String[] args) {
    		@SuppressWarnings("resource")
    		Scanner scanner=new Scanner(System.in);
    		int a= scanner.nextInt();
    		if (a%2==0) 
    			System.out.println("y e s");		
    		else 
    		System.out.println("n o");
    		}
    }
    

    Python :

    r = int(input())
    if r % 2 == 0 :
       print('y e s') 
    else:
        print('n o') 
    
    • 1

    信息

    ID
    32
    时间
    1000ms
    内存
    512MiB
    难度
    9
    标签
    递交数
    7
    已通过
    6
    上传者