6 条题解

  • 5
    @ 2023-6-12 16:53:54

    #include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; if(n%30){ cout<<"3 "; } if(n%50){ cout<<"5 "; } if(n%7==0){ cout<<"7 "; } if(n%3!=0 and n%5!=0 and n%7!=0){ cout<<"n "; }

    return 0;
    

    }

    • 2
      @ 2023-5-29 17:08:20

      #include<bits/stdc++.h> using namespace std; int main(){ int n,c=1; cin>>n; if(n%30) cout<<"3"<<" ",c=0; if(n%50) cout<<"5"<<" ",c=0; if(n%7==0) cout<<"7",c=0; if(c) cout<<"n"; return 0; }

      • 1
        @ 2023-6-26 17:02:48
        #include<bits/stdc++.h>
         using namespace std; 
        int main(){ 
        int n,f=1;
         cin>>n; 
        if(n% 3==0){
         cout<<"3"<<" ";
        f=0;
        }
         if(n%5==0){
         cout<<"5 ";
        f=0;
        }
         if(n%7==0){
         cout<<"7";
        f=0;
        }
         if(f==1){
         cout<<"n";}
         return 0; 
        }
        

        Copy

        資訊

        遞交者 666 (yiyuanhehuan) LV 4題目y1047 [ybt]1047 判断能否被3,5,7整除語言C++ 14遞交時間13 秒前分數100總耗時20ms峰值記憶體376 KiB

        • 1
          @ 2023-6-26 16:53:32

          #include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; if(n%30){ cout<<"3 "; } if(n%50){ cout<<"5 "; } if(n%7==0){ cout<<"7 "; } if(n%3!=0 && n%5!=0 && n%7!=0){ cout<<"n "; }

          return 0; }

          • 0
            @ 2023-6-26 17:02:58
            #include<bits/stdc++.h>
            #include<cmath>
            #include<iomanip>
            
            using namespace std;
            
            int main(){
            double a,b,c;
            double x1,x2;
            cin>>a>>b>>c;
            x1=( -b-sqrt(b*b-4*a*c) )/(2*a);
            x2=( -b+sqrt(b*b-4*a*c) )/(2*a);
            if(b*b-4*a*c>0){
            cout<<fixed<<setprecision(5)<<"x1="<<x1<<";"<<"x2="<<x2;
            }
            else if(b*b-4*a*c==0){
            cout<<fixed<<setprecision(5)<<"x1=x2="<<x1;
            }
            else{
            cout<<"No answer!";
            }
            return 0;
            }
            
            • 0
              @ 2023-6-26 16:50:00

              #include<iostream> using namespace std; int main(){ int n,f=1; cin>>n; if(n%30){ cout<<"3 "; f=0; } if(n%50){ cout<<"5 "; f=0; } if(n%70){ cout<<"7 "; f=0; } if(f1){ cout<<"n"; } return 0; }

              • 1

              [ybt]1047 判断能否被3,5,7整除

              信息

              ID
              605
              时间
              1000ms
              内存
              256MiB
              难度
              6
              标签
              (无)
              递交数
              470
              已通过
              150
              上传者