2 条题解

  • 0
    @ 2026-9-16 23:08:13
    #include<stdio.h>
    
    int main(){
        int n;
        scanf("%d", &n);
        
        if(n >= 2) {
            printf("2");
            for(int i = 4; i <= n; i += 2) {
                printf(" %d", i);
            }
        }
        
        return 0;
    }
    
    
    • 0
      @ 2025-9-15 0:45:11
      #include<bits/stdc++.h>
      using namespace std;
      // const int N=1e6+10;
      
      signed main(){
          int _=1;
          // cin>>_;
          while (_--) {
              int n;
              cin>>n;
              for(int i=2;i<=n;i+=2) cout<<i<<" ";
          }
      }
      
      • 1

      信息

      ID
      67
      时间
      1000ms
      内存
      256MiB
      难度
      7
      标签
      递交数
      124
      已通过
      30
      上传者