6 条题解

  • 6
    @ 2022-8-26 10:42:28
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int a,b,c,d,e;
        cin>>a>>b>>c>>d>>e;
        a/=3;
        e+=a;
        b+=a;
        b/=3;
        a+=b;
        c+=b;
        c/=3;
        b+=c;
        d+=c;
        d/=3;
        c+=d;
        e+=d;
        e/=3;
        d+=e;
        a+=e;
        cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
        return 0;
    }
    
    • 3
      @ 2022-10-11 20:13:46

      小号第6题。

      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          int a,b,c,d,e;
          cin>>a>>b>>c>>d>>e;
          a/=3; e+=a; b+=a; b/=3; a+=b; c+=b; c/=3; b+=c; d+=c; d/=3; c+=d; e+=d; e/=3; d+=e; a+=e;
          cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e; 
          return 0;
      }
      
      
      • 3
        @ 2022-8-11 16:25:08

        #include <bits/stdc++.h> using namespace std; int main() { int a,b,c,d,e,x; cin>>a>>b>>c>>d>>e; x=a/3; a=x; b+=x; e+=x; x=b/3; b=x; a+=x; c+=x; x=c/3; c=x; b+=x; d+=x; x=d/3; d=x; c+=x; e+=x; x=e/3; e=x; a+=x; d+=x; cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e; return 0; }

        • 3
          @ 2022-8-6 17:10:27
          #include <bits/stdc++.h>
          using namespace std;
          int a[10], x;
          int main()
          {
              for (int i = 1; i <= 5; i++)
              {
                  cin >> a[i];
              }
              for (int i = 1; i <= 5; i++)
              {
                  x = a[i] / 3;
                  if (i == 1)
                  {
                      a[i + 1] += x;
                      a[5] += x;
                  }
                  else if (i == 5)
                  {
                      a[1] += x;
                      a[i - 1] += x;
                  }
                  else
                  {
                      a[i + 1] += x;
                      a[i - 1] += x;
                  }
                  a[i] -= x * 2 + a[i] % 3;
              }
              for (int i = 1; i <= 5; i++)
              {
                  cout << a[i] << " ";
              }
              return 0;
          }
          
          • 2
            @ 2022-4-24 20:10:42

            #include <bits/stdc++.h>

            using namespace std;

            int main()

            {

            int a,b,c,d,e,x;
            
            cin>>a>>b>>c>>d>>e;
            
            x=a/3;
            
            a=x;
            
            b+=x;
            
            e+=x;
            
            x=b/3;
            
            b=x;
            
            
            a+=x;
            
            c+=x;
            
            x=c/3;
            
            c=x;
            
            b+=x;
            
            d+=x;
            
            x=d/3;
            
            d=x;
            
            c+=x;
            
            e+=x;
            
            x=e/3;
            
            e=x;
            
            a+=x;
            
            d+=x;
            
            cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e;
            
            return 0;
            

            }

            • 1
              @ 2022-4-24 20:09:24

              #include <bits/stdc++.h> using namespace std; int main() { int a,b,c,d,e,x; cin>>a>>b>>c>>d>>e; x=a/3; a=x; b+=x; e+=x; x=b/3; b=x; a+=x; c+=x; x=c/3; c=x; b+=x; d+=x; x=d/3; d=x; c+=x; e+=x; x=e/3; e=x; a+=x; d+=x; cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e; return 0; }

              • 1

              信息

              ID
              26
              时间
              1000ms
              内存
              16MiB
              难度
              4
              标签
              递交数
              546
              已通过
              262
              上传者