1 solutions

  • 0
    @ 2025-3-3 16:33:41

    C :

    #include<stdio.h>
    
    void main(){
    	int i,g,s,b;
    	
    	for(i=100;i<=999;i++){
    		g=i%10;
    		s=i/10%10;
    		b=i/100;
    		if(g==b&&i%2==0){
    			printf("%d\n",i);
    		} 
    	} 
    }
    

    C++ :

    #include <bits/stdc++.h>
    using namespace std;
    
    int main(){
    	int i,g,s,b;
    	for(i = 100;i <= 999;i++){
    		b = i / 100;
    		s = i / 10 % 10;
    		g = i % 10;
    		if(b == g && i % 2 == 0){
    			cout<<i<<endl;
    		}
    	}
        return 0;
    }
    
    

    Python :

    for n in range(100,1000):
        a=n//100
        b=n//10%10
        c=n%10
        if a==c and c%2==0:
            print(n)
    
    • 1

    Information

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