22 条题解

  • 4
    @ 2024-3-24 9:16:01
    #include<iostream>
    using namespace std;
    int main(){
    	int a,day=1;
    	cin>>a;
    	while(a!=1){
    	    a =a/2;	
    	    day++;
        }
        cout<<day;
        return 0;
    }
    
    • 2
      @ 2024-3-17 10:08:15

      别抄答案

      • 1
        @ 2025-3-30 10:21:46

        #include <bits/stdc++.h>

        using namespace std;

        int main(){
        int a,x = 1;
        cin >> a;
        while(a != 1)
        {
            x++;
            a = a / 2;
        }
        cout << x;
        return 0;
        

        }

        • 1
          @ 2025-3-30 10:21:16

          #include using namespace std; int main(){ int a,day=1; cin>>a; while(a!=1){ a =a/2; day++; } cout<<day; return 0; }

          • 1
            @ 2024-3-17 10:03:24
            #include<iostream>
            using namespace std;
            int main(){
            	int a,day=1;
            	cin>>a;
            	while(a!=1){
            	    a =a/2;	
            	    day++;
                }
                cout<<day;
                return 0;
            }
            
            • 0
              @ 2025-4-2 13:43:10
              #include<bits/stdc++.h>
              using namespace std;
              int main(){
              	int m,n=2,i=0,sum=0;//意义不明的变量n和i
              	cin>>m;
              	while (m>=1){
              		m=m/2;
              		sum+=1;
              	}
              	cout<<sum<<endl;
              	return 0;
              } 
              
              • 0
                @ 2025-3-30 11:18:33

                #include using namespace std; int main(){ int a,day=1; cin>>a; while(a!=1){ a =a/2; day++; } cout<<day; return 0; }

                • 0
                  @ 2025-3-30 10:47:00

                  #include<bits/stdc++.h> using namespace std; int main(){ int i=1,a; cin>>a; while(a!=1){ i++; a=a/2; } cout<<i; return 0; }

                  • 0
                    @ 2024-3-23 12:02:52

                    #include<bits/stdc++.h> using namespace std; int main() { int i,n=1; cin>>i; for(i=1;i<=n;n++ ){ if(i%2==0){ n=n+i; }

                    } cout<<n; return 0; }

                    • 0
                      @ 2024-3-17 15:50:28

                      #include<bits/stdc++.h> using namespace std; int main(){ int day=1,a; cin>>a; while(a!=1){ a = a/2; day++; } cout<<day; return 0; }

                      • 0
                        @ 2024-3-17 10:12:34
                        #include<bits/stdc++.h>
                        using namespace std;
                        int main(){
                        	int a,day=1;
                        	cin>>a;
                        	while(a!=1){
                        		a = a/2;
                        		day++;
                        	}
                        	cout<<day;
                        	return 0;
                        }
                        
                        • 0
                          @ 2024-3-17 10:12:22

                          成功不止一种配方

                          • -1
                            @ 2024-3-17 10:08:58

                            这里的用a>1或a!=1都可以

                            #include<bits/stdc++.h>
                            using namespace std;
                            int main(){
                            	int a,day=1;
                            	cin>>a;
                            	while(a!=1){
                            		a = a/2;
                            		day++;
                            	}
                            	cout<<day;
                            	return 0;
                            }
                            
                            • -1
                              @ 2024-3-17 10:08:30
                              #include<bits/stdc++.h>
                              using namespace std;
                              int main(){
                              	int a,day=1;
                              	cin>>a;
                              	while(a!=1){
                              		a = a/2;
                              		day++;
                              	}
                              	cout<<day;
                              	return 0;
                              }
                              
                              
                              
                              
                              • -2
                                @ 2024-3-17 10:10:07
                                > > #include<bits/stdc++.h>
                                using namespace std;
                                int main(){
                                	int a,day=1;
                                	cin>>a;
                                	while(a!=1){
                                		a = a/2;
                                		day++;
                                	}
                                	cout<<day;
                                	return 0;
                                }
                                
                                • -2
                                  @ 2024-3-17 10:08:15
                                  using namespace std;
                                  int main(){
                                  	int a,day=1;
                                  	cin>>a;
                                  	while(a!=1){
                                  		a =a/2;
                                  		day++;
                                  	}
                                  	cout<<day;
                                      return 0;
                                  }
                                  
                                  • -3
                                    @ 2024-3-17 10:07:44

                                    #include<bits/stdc++.h> using namespace std; int main(){ int a,day=1; cin>>a; while(a!=1){ a =a/2; day++; } cout<<day; return 0; }

                                    • -3
                                      @ 2024-3-17 9:32:36

                                      #include<bits/stdc++.h> using namespace std; int main(){ long long n,sum=0; cin>>n; while(n>=1){ n=n/2; sum++; } cout<<sum; return 0; }

                                      • -4
                                        @ 2024-3-14 17:21:43
                                        #include<bits/stdc++.h> 
                                        using namespace std; 
                                        int main(){ 
                                            long long n;
                                            long long sum=0;
                                            cin>>n;
                                            while(n>=1){
                                                n/=2;
                                                sum++;
                                            }
                                            printf("%.1ld",sum);
                                            return 0;
                                        }
                                            
                                        
                                        • -4
                                          @ 2024-3-10 9:52:16
                                          #include<bits/stdc++.h> 
                                          using namespace std; 
                                          int main(){ 
                                              int a,b=0;
                                              cin>>a;
                                              while(a>=1){
                                                  a/=2;
                                                  b++;
                                              }
                                              printf("%.1ld",b);
                                              return 0;
                                          }
                                          

                                          信息

                                          ID
                                          644
                                          时间
                                          1000ms
                                          内存
                                          125MiB
                                          难度
                                          3
                                          标签
                                          (无)
                                          递交数
                                          632
                                          已通过
                                          341
                                          上传者