5 solutions

  • 4
    @ 2024-10-22 12:28:46
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int m;
        cin>>m;
        int s=0,n=1;
        while(s<=m)
        {
            s+=n;
            n++;
        }
        n--;
        cout<<n;
        return 0;
    }
    
    • 0
      @ 2026-8-6 15:47:32
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          int m;
      	cin>>m;
      	int s=0;
      	int n=1;
      	while(s+n<=m)
      	{
      		s+=n;
      		n++;
      	}
      	cout<<n;
      	return 0; 
      }
      
      • -7
        @ 2024-7-5 11:31:29

        😄

        • -8
          @ 2024-7-5 11:26:45

          👎 👎 👎

          • -9
            @ 2024-5-26 11:16:21

            A AAA

          • 1

          Information

          ID
          48
          Time
          1000ms
          Memory
          256MiB
          Difficulty
          1
          Tags
          (None)
          # Submissions
          301
          Accepted
          111
          Uploaded By