24 条题解

  • 0
    @ 2023-3-26 18:40:35
    #include <iostream>
    #include <stdio.h>
    #include <string.h>
    using namespace std;
    double n,sum,day;
    int main(){
    	cin>>n;
    	for(int i=1;i<=n;i++){
    			sum=sum+1*1;;
    			day=(i+1)*i/2;
    			if(day==n){
    				cout<<sum;
    				return 0;
    			}
    	}
    } 
    
    • 0
      @ 2023-3-13 17:31:11
      #include <stdio.h>
      #include <iostream>
      using namespace std;
      int main()
      {
      	int n;
      	cin >> n;
      	int sum = 0;
      	int num =1,day = 1;
      	for (int i = 1 ; i <= n ; i++)
      	{
      		sum += num;
      		day -= 1;
      		if(day ==0)
      		{
      			num++;
      			day = num;
      		}
      	}
      	cout << sum << endl;
      }
      
      • -1
        @ 2023-3-26 18:14:34
        #include <stdio.h>
        #include <iostream>
        using namespace std;
        int main()
        {
        	int n;
        	cin >> n;
        	int sum = 0;
        	int num =1,day = 1;
        	for (int i = 1 ; i <= n ; i++)
        	{
        		sum += num;
        		day -= 1;
        		if(day ==0)
        		{
        			num++;
        			day = num;
        		}
        	}
        	cout << sum << endl;
        }
        
        • -3
          @ 2022-2-23 21:53:06

          #include #include<bits/stdc++.h> using namespace std; int main(){ int temp=1,n,a=0,s=1,w=1; cin>>n; while(1){ a+=temp; if(temps){ temp++; s=0; } if(wn){ cout<<a; return 0; } s++; w++; } }

          信息

          ID
          919
          时间
          1000ms
          内存
          128MiB
          难度
          5
          标签
          递交数
          1159
          已通过
          471
          上传者