#16724: c++ AC


Easonsfriend (去寫./Problems?ownerid=89827)

學校 : 不指定學校
編號 : 89827
來源 : [106.105.188.90]
最後登入時間 :
2024-04-03 19:33:43
a147. Print it all | From: [106.105.188.90] | 發表日期 : 2019-02-01 23:12

 

 

 

 

 

 

 

 

 

 

 

 

 

#include <iostream>
using namespace std;

int main()
{


    int a;
    while(cin>>a){

  for(int i=1;i<a;i++){
        if(i%7!=0){  //如果i除以7不等於0則輸出i
        cout<<i<<" ";
        }



  }
cout<<endl;//輸出換行
}



    return 0;

}
 
#16725: Re:c++ AC


Easonsfriend (去寫./Problems?ownerid=89827)

學校 : 不指定學校
編號 : 89827
來源 : [106.105.188.90]
最後登入時間 :
2024-04-03 19:33:43
a147. Print it all | From: [106.105.188.90] | 發表日期 : 2019-02-01 23:14

 

 

 

 

 

 

 

 

 

 

 

 

 

#include 
using namespace std;

int main()
{


    int a;
    while(cin>>a){

  for(int i=1;i<a;i++){
        if(i%7!=0){  //如果i除以7不餘0則輸出i
        cout<<i<<" ";
        }



  }
cout<<endl;//輸出換行
}



    return 0;

}




 
ZeroJudge Forum