9 条题解

  • -1
    @ 2024-5-24 18:53:14

    #include<bits/stdc++.h> 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; cout<<a28.9+b32.7+c45.6+d78+e35+f86.2+g27.8+h43+i56+j65; return 0; }

    • -1
      #include <iostream>
      #include <iomanip>
      using namespace std;
      double b[20]={0,28.9,32.7,45.6,78,35,86.2,27.8,43,56,65};
      double a[110]={ },ans;
      int main()
      {
      	for(int i=1;i<=10;i++)
      	{
      		cin>>a[i];
      	}
      	for(int i=1;i<=10;i++)
      	{
      		ans+=b[i]*a[i];
      	}
      	cout<<fixed<<setprecision(1)<<ans;
      	return 0;
       } 
      
      
      • -1
        @ 2023-1-3 15:57:39
        #include<bits/stdc++.h>
        using namespace std;
        double ans;
        double a[15]={28.9,32.7,45.6,78,35,86.2,27.8,43,56,65};
        int main()
        {
        	ios::sync_with_stdio(false);
        	cin.tie(0);
        	cout.tie(0);
        	for(int i=0;i<10;i++)
        	{
        		int x;
        		scanf("%d",&x);
        		ans+=x*a[i];
        	}
        	printf("%.1lf",ans);
        	return 0;
        }
        
        • -1
          @ 2022-10-26 20:24:06
          #include <iostream>
          #include <stack>
          #include <cmath>
          #include <vector>
          #include <string.h>
          #include <queue>
          #include <stdio.h>
          #include <iomanip>
          #include <cstdio>
          #include <algorithm>
          #define int long long
          using namespace std;
          const int N = 1e5 + 10;
          const int INF = 0x3f3f3f3f;
          double a[11] = {28.9, 32.7, 45.6, 78.0, 35.0, 86.2, 27.8, 43.0, 56.0, 65.0, 0};
          double x;
          signed main()
          {
          	double ans = 0;
          	for(int i = 0; i < 10; i++)
          	{
          		cin >> x;
          		ans += a[i] * x;
          	}
          	cout << fixed << setprecision(1) << ans << endl;
          	return 0;
          }
          

          有打表那味了

          • -2
            @ 2023-7-10 15:47:28

            #include <iostream> #include <cmath> #include <iomanip> #include <stack> #include <algorithm> #include <string> #include <cstring> #include <cstdio> using namespace std; const int INF = 0x3f3f3f3f; const int N = 1e4 + 10; double a[21] = {0 , 28.9 , 32.7 , 45.6 , 78 , 35 , 86.2 , 27.8 , 43 , 56 , 65} , sum , n; int main() { for (int i = 1;i <= 10;i++) { cin >> n; sum = sum + a[i] * n; } cout << sum; return 0; }

            • -2
              @ 2022-8-11 20:40:33
              #include <bits/stdc++.h>
              
              using namespace std;
              
              int main(void)
              {
              	double price[10] = { 28.9, 32.7, 45.6, 78.0, 35.0, 86.2, 27.8, 43.0, 56.0, 65.0 };
              
              	int x[9];
              
              	for (int i = 0; i <= 9; i++)
              	{
              		cin >> x[i];
              	}
              
              	float f = 0;
              
              	for (int i = 0; i <= 9; i++)
              	{
              		f += price[i] * x[i];
              	}
              
              	cout << f;
              
              	return 0;
              }
              
              • -3
                @ 2022-12-30 16:32:28
                #include<iostream>
                #include<iomanip>
                #include<math.h>
                using namespace std;
                int main(){
                	double a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,s;
                	cin>>a1>>a2>>a3>>a4>>a5>>a6>>a7>>a8>>a9>>a10;
                	s=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)<<s; 
                }
                
                • -3
                  @ 2022-10-19 21:55:34
                  #include <bits/stdc++.h>
                  using namespace std;
                  int main(){
                  	double a[11]={28.9,32.7,45.6,78,35,86.2,27.8,43,56,65},s=0;
                  	int n;
                  	for(int i=0;i<=10;i++){
                  		cin>>n;
                  		s+=n*a[i];
                  	}
                  	cout<<s<<endl;
                  }
                  
                  • -3
                    @ 2022-8-10 9:33:58
                    #include<queue>
                    #include<math.h>
                    #include<stack>
                    #include<stdio.h>
                    #include<iostream>
                    #include<vector>
                    #include<iomanip>
                    #include<string.h>
                    #include<algorithm>
                    #include<bits/stdc++.h>
                    using namespace std;
                    double a[11]={0,28.9,32.7,45.6,78,35,86.2,27.8,43,56,65};
                    int main()
                    {
                    	int x;
                    	double sum=0.0;
                    	for(int i=1;i<=10;i++)
                    	{
                    		cin>>x;
                    		sum+=a[i]*x;
                    	}
                    	cout<<fixed<<setprecision(1)<<sum<<endl;
                    }
                    

                    image

                    • 1

                    信息

                    ID
                    1003
                    时间
                    1000ms
                    内存
                    128MiB
                    难度
                    5
                    标签
                    递交数
                    614
                    已通过
                    257
                    上传者