1 条题解

  • 0
    @ 2025-4-12 22:06:17

    C++ :

    #include<cstdio>
    #include<cmath>
    #include<iostream>
    using namespace std;
    int main()
    {
        double a,b;
        while(scanf("%lf%lf",&a,&b)!=EOF)
        {
            printf("%.0lf\n",pow(b,1.0/a));
           // cout<<pow(b,1.0/a)<<endl;
        }
    }
    
    

    Java :

    import java.util.Scanner;
    
    public class Main {
    
    	public static void main(String[] args) {
    		Scanner sc = new Scanner(System.in);
    		int n;
    		double m;
    		while (sc.hasNext()) {
    			n = sc.nextInt();
    			m = sc.nextDouble();
    			m = Math.pow(m, 1.0 / n);
    			System.out.println(Math.round(m));
    		}
    	}
    }
    
    
    • 1

    信息

    ID
    2892
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    (无)
    递交数
    0
    已通过
    0
    上传者