#11606: 簡單C++解


10512133 (我要開始刷題了)


#include<iostream>
using namespace std;
int main()
{
  int a,b,c,d,e,i,t;
  cin>>t;
  for(i=1;i<=t;i++)
   {
       cin>>a>>b>>c>>d;
   if(d-c==c-b)
    {
   e=d+c-b;  cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
    }
   else
    {
   e=d*c/b; cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
    }
   }
  return 0;
}

#13053: Re:簡單C++解


fok1408 (好想學c++)


int main()

{

    

int t,i,a,b,c,d,e;

cin>>t;

 

 for(i=0;i<t;i++)

 {

   cin>>a>>b>>c>>d;

  

    if(b-a==c-b)

     {

     e=d+(b-a); 

     cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;  

     }    

         else

         {

          e=d*(b/a);   

          cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;     

         }

           

      

 }

 

system("pause");

return 0;

 

}

 

 

請問我的跟你的有甚麼不一樣?為甚麼我的不會過

#13354: Re:簡單C++解


steve2020301@gmail.com (Deltora Steve)


int main()

{

    

int t,i,a,b,c,d,e;

cin>>t;

 

 for(i=0;i<t;i++)

 {

   cin>>a>>b>>c>>d;

  

    if(b-a==c-b)

     {

     e=d+(b-a); 

     cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;  

     }    

         else

         {

          e=d*(b/a);   

          cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;     

         }

           

      

 }

 

system("pause");

return 0;

 

}

 

 

請問我的跟你的有甚麼不一樣?為甚麼我的不會過

c++沒有system指令


#15206: Re:簡單C++解


26778695 (tingya)


#include
using namespace std;
int main()
{
  int a,b,c,d,e,i,t;
  cin>>t;
  for(i=1;i<=t;i++)
   {
       cin>>a>>b>>c>>d;
   if(d-c==c-b)
    {
   e=d+c-b;  cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
    }
   else
    {
   e=d*c/b; cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;
    }
   }
  return 0;
}

t和i有什麼意義嗎