#5171: 拜託各位大大!!


Vincent10 (135826)


#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    int s,t,a,b,c,d;
    while(cin>>s)
    {
     cin>>a>>b>>c>>d;
     if(a/b==c/d)
     {
      for(t=1;t<s;t++)
      {
      cout<< a <<" "<< b <<" "<< c <<" "<< d <<" "<< d*2 <<endl;
             }      
              }
      else
      cout<< a <<" "<< b <<" "<< c <<" "<< d <<" "<< b+1 <<endl;
      }
    return EXIT_SUCCESS;
}
這是我的程式~~

各位大大幫我看看錯在哪裡吧~~~~~~

#5172: Re:拜託各位大大!!


Vincent10 (135826)


#include
#include

using namespace std;

int main(int argc, char *argv[])
{
    int s,t,a,b,c,d;
    while(cin>>s)
    {
     cin>>a>>b>>c>>d;
     if(a/b==c/d)
     {
      for(t=1;t      {
      cout<< a <<" "<< b <<" "<< c <<" "<< d <<" "<< d*2 <             }      
              }
      else
      cout<< a <<" "<< b <<" "<< c <<" "<< d <<" "<< d+1 <      }
    return EXIT_SUCCESS;
}
這是我的程式~~

各位大大幫我看看錯在哪裡吧~~~~~~

有小錯誤

還是請各位大大幫忙吧~~


#5173: Re:拜託各位大大!!


tomoyaken14 (歐練)


公差不一定是1

公比也不一定是2