1 条题解

  • 0
    @ 2024-9-3 22:03:13

    C++ :

    #include <stdio.h>
    #include <string.h>
    #include <iostream>
    #include <string>
    #include <algorithm>
    using namespace std;
    
    int a[1005];
    
    int main() {
      //freopen("Dongqi.in", "r", stdin);
    	//freopen("Dongqi.out", "w", stdout);
      int n;
      a[1] = 4;
      for (int i = 2; i <= 1000; i++) {
        a[i] = a[i - 1] + 8;
      }
      while (scanf("%d", &n) != EOF) {
        if (n == 0)
          break;
        else
          printf("%d\n", a[n]);
      }
      return 0;
    }
    
    • 1

    信息

    ID
    32
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者