1 solutions

  • 0
    @ 2023-12-3 17:03:15

    C :

    #include <stdio.h>
    #include <stdlib.h>
    int main()
    {
    	printf("7744");
    	return 0;
    }
    //Author: ITProgrammer
    

    C++ :

    #include <iostream>
    #include <iomanip>
    #include <cmath>
    
    using namespace std;
    
    int main(){
        for(int i=1100;i<=9999;i++){
        	if(sqrt(i)==(int)sqrt(i)&&i/1000==i/100%10&&i/10%10==i%10){
        		cout<<i<<endl;
    		}
    	}
    }
    

    Python :

    def pfs(x):
        for i in range(33, 100):
            if i * i == x:
                return True
        return False
    
    
    for a in range(1, 10):
        for b in range(0, 10):
            if a != b:
                s = a * 1000 + a * 100 + b * 10 + b
            if pfs(s) is True:
                print(s)
    
    • 1

    Information

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