1 条题解

  • 0
    @ 2024-12-24 10:06:18

    C :

    #include<stdio.h>
    main()
    {
    	int i,t,a,b,c;
    	for(i=100;i<999;i++)
    	{
    		t=i;
    		c=t%10;  t/=10;
    		b=t%10;  t/=10;
    		a=t%10;  t/=10;
    		if(i==(a*a*a+b*b*b+c*c*c))
    			printf("%d\n",i);
    	}
    }
    

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        cout<<"153\n370\n371\n407";
        return 0;
    }
    
    • 1

    信息

    ID
    2617
    时间
    1000ms
    内存
    128MiB
    难度
    10
    标签
    递交数
    1
    已通过
    0
    上传者