6 solutions

  • 2
    @ 2023-12-30 22:49:41
    #include<bits/stdc++.h>
    using namespace std;
    double a1,a2,a3,a4,a5,a6,a7,a8,a9,a10;
    double sum=0;
    int main(){
    	cin>>a1>>a2>>a3>>a4>>a5>>a6>>a7>>a8>>a9>>a10;
    	sum=a1*28.9+a2*32.7+a3*45.6+a4*78+a5*35+a6*86.2+a7*27.8+a8*43+a9*56+a10*65;
    	cout<<fixed<<setprecision(1)<<sum<<endl;
    	return 0;
    }
    

    朴实无华

    • 2
      @ 2023-12-23 16:51:39
      #include<bits/stdc++.h>
      using namespace std;
      double f=0,b[15]={28.9,32.7,45.6,78,35,86.2,27.8,43,56,65};
      int a[15];
      int main(){
          for(int i=0;i<10;i++){
          	cin>>a[i];
          	f+=a[i]*b[i];
      	}
          cout<<f<<"\n";
          return 0;
      }
      //shortest code ever
      
      • 1
        @ 2023-12-15 20:31:24
        #include<bits/stdc++.h>
        #include<string>
        using namespace std;
        int main(){
            int n=10;
            double f=0,b[10]={28.9,32.7,45.6,78,35,86.2,27.8,43,56,65};
            const int N=n;
            int a[N];
            for(int i=0;i<N;i++) cin>>a[i];
            for(int k=0;k<N;k++) f+=a[k]*b[k];
            cout<<f;
            return 0;
        }
        
      • 0
        @ 2023-12-17 22:02:53
        #include <iostream>
        using namespace std;
        int main(){
        	double a , b , c , d , e , f , g , h , i , j;
        	cin >> a >> b >> c >> d >> e >> f >> g >> h >> i >> j;
        	a = 28.9 * a;
        	b = 32.7 * b;
        	c = c * 45.6;
        	d = d * 78;
        	e = e * 35;
        	f = f * 86.2;
        	g = g * 27.8;
        	h = h * 43;
        	i = i * 56;
        	j = j * 65;
        	double y = a + b + c + d + e+ f+g +h+i+j;
        	printf("%.1lf" , y);
        	return 0;
        }
        
        • 0
          @ 2023-10-3 12:49:38

          #include<bits/stdc++.h> #include using namespace std; int main(){ int n=10; double f=0; const int N=n; int a[N]; double b[10]={28.9,32.7,45.6,78,35,86.2,27.8,43,56,65};

          for(int i=0;i<N;i++){
          	cin>>a[i];
          

          } for(int k=0;k<N;k++){ f+=a[k]*b[k]; } cout<<f;

          return 0;
          

          }

          • 0
            @ 2023-10-3 11:06:08

            #include<bits/stdc++.h> using namespace std;

            int main(){ double a1,a2,a3,a4,a5,a6,a7,a8,a9,a0,s=0; cin>>a1>>a2>>a3>>a4>>a5>>a6>>a7>>a8>>a9>>a0; s=a128.9+a232.7+a345.6+a478+a535+a686.2+a727.8+a843+a956+a065; printf("%.1f",s);

            }

            • 1

            Information

            ID
            590
            Time
            1000ms
            Memory
            256MiB
            Difficulty
            1
            Tags
            # Submissions
            33
            Accepted
            28
            Uploaded By