1 solutions

  • 0
    @ 2025-12-3 17:12:23

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    int n,ans;
    void f(int x)
    {
    	ans++;
    	if(x==1) return ;
    	for(int i=1;i<=sqrt(x);i++)	f(i);
    }
    int main()
    {   
     	cin>>n;
     	f(n);
     	cout<<ans;
        return 0;
    }
    
    • 1

    2019NHOI初中模拟第四题 求数组元素(3.5)

    Information

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