10 solutions

  • 1
    @ 2026-7-10 14:40:57
     #include<bits/stdc++.h>
    using namespace std;
    double s[110][110];
    int main()
    {
        int a;
        cin>>a;
        double c=0,d=0;
        for(int i=0;i<a;i++)
        {
            for(int j=0;j<a;j++)
            {
                cin>>s[i][j];
                if(i<j)
                {
                    c+=s[i][j];
                    d++;
                }
            }
        }
        cout<<fixed<<setprecision(1)<<c*1.0/d;
        return 0; 
    }
    //看过的请给我点👍
    
    • 1
      @ 2026-6-27 9:24:45

      • -1
        @ 2026-5-2 15:42:40
        #include<bits/stdc++.h>
        using namespace std;
        double a[110][110];
        int main()
        {
        	int n;
        	cin>>n;
        	for(int i=1;i<=n;i++)
        	{
        		for(int j=1;j<=n;j++)
        		{
        			cin>>a[i][j];
        		}
        	}
        	double c=0;
        	int  s=0;
        	for(int i=1;i<=n;i++)
        	{
        		for(int j=i+1;j<=n;j++)
        		{
        			c+=a[i][j];
        
        		s++;
        	}
        }
        cout<<fixed<<setprecision(1)<<c/s;
        return 0;
        

        }

        • -2
          @ 2024-11-24 9:14:48
          #include<bits/stdc++.h>
          using namespace std;
          int a[100][100];
          int main(){
              int n,c=0;
              cin>>n;
              double p=0;
              for(int i=1;i<=n;i++){
                  for(int j=1;j<=n;j++){
                      cin>>a[i][j];
                  }
              }
              for(int i=1;i<=n;i++){
                  for(int j=i+1;j<=n;j++){
                      p+=a[i][j];
                      c++;
                  }
              }
              p/=c;
              cout<<fixed<<setprecision(1)<<p;
              return 0;
          }
          
          • @ 2025-8-27 13:49:55
            #include<bits/stdc++.h>
            using namespace std;
            double arr[110][110]; 
            int n;
            int main(){
            	cin>>n;
            	double cnt=0;
            	int sum=0;
            	for(int i=1;i<=n;i++){
            		for(int j=1;j<=n;j++){
            			cin>>arr[i][j];
            		}
            	}
            	for(int i=1;i<=n;i++){
            		for(int j=1;j<=n;j++){
            			if(j>i){
            				cnt+=arr[i][j];
            				sum++;	
            			}	
            		}
            	}
            	cnt/=sum;
            	cout<<fixed<<setprecision(1)<<cnt;
            	return 0;
            }
            
            
          • @ 2025-8-27 13:50:25

            他这个是错的

        • -3
          @ 2024-9-27 20:42:23

          • -3
            @ 2024-9-27 20:41:30

            UOJ_1183.png

            • -3
              @ 2024-5-18 11:45:42
              #include<bits/stdc++.h>
              using namespace std;
              const int N=110;
              double a[N][N];
              int main()
              {
               	int n;
               	cin>>n;
               	int m=0;
               	double s=0;
               	for(int i=1;i<=n;i++)
               	{
               		for(int j=1;j<=n;j++)
               		{
               			cin>>a[i][j];	
              		}
              	}
              	for(int i=1;i<=n;i++)
              	{
              		for(int j=1;j<=n;j++)
              		{
              			if(j>i)
              			{
              				s+=a[i][j];
              				m++;
              			}
              		}
              	}
              	cout<<fixed<<setprecision(1)<<s/m;
                  return 0;
              }
              
              
            • -4
              @ 2024-3-27 20:12:37

              image

              #include<bits/stdc++.h>
              using namespace std;
              const int N=110;
              double a[N][N];
              int main()
              {
              	int n;
              	cin>>n;
              	int m=0;
              	double s=0;
              	for(int i=1;i<=n;i++)
              	{
              		for(int j=1;j<=n;j++)
              		{
              			cin>>a[i][j];
              		}
              	}
              	for(int i=1;i<=n;i++)
              	{
              		for(int j=1;j<=n;j++)
              		{
              			if(j>i)
              			{
              				s+=a[i][j];
              				m++;
              			}
              		}
              	}
                  cout<<fixed<<setprecision(1)<<s/m;
                  return 0;
              }
              
              • -6
                @ 2024-5-18 11:36:19

                UOJ_1183.png

                • -9
                  @ 2024-3-24 11:38:10

                  UOJ_1183.png

                  • 1

                  Information

                  ID
                  70
                  Time
                  1000ms
                  Memory
                  256MiB
                  Difficulty
                  1
                  Tags
                  (None)
                  # Submissions
                  191
                  Accepted
                  57
                  Uploaded By