5 条题解

  • 3
    @ 2023-8-19 20:58:54

    日常打卡第14题👀️

    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n;
        cin >> n;
        for (int i = 1; i <= n; i += 3) cout << i << endl;
        return 0;
    }
    
    • 1
      @ 2023-2-20 20:40:12

      基础版

      #include <iostream>
      using namespace std;
      int main()
      {
      	int i, n;
      	cin >> n;
      	for (i = 1; i <= n; i += 3)
          {
      		cout << i << endl;
      	}
          return 0;
      }
      

      加强版

      #include <iostream>
      using namespace std;
      int main()
      {
      	int n;
      	cin >> n;
      	for (int i = 1; i <= n; i++)
      	{
      		if (3 * i - 2 <= n)
      		{
      			cout << 3 * i - 2 << endl;
      		}
      	}
      	return 0;
      }
      
      • 0
        @ 2023-10-4 19:36:56

        #include <bits/stdc++.h> using namespace std; int n; int main() { cin>>n; for (int i=1;i<=n;i+=3) { cout<<i<<endl; } return 0; } 没什么说的

        • 0
          @ 2023-8-6 17:42:57
          #include <bits/stdc++.h>
          using namespace std;
          int main(){
              int n;
              cin >> n;
              for (int i = 1; i <= n; i += 3) cout << i << "\n";
          }
          
          • -1
            @ 2023-5-25 13:16:34
            #include <bits/stdc++.h>
            using namespace std;
            int n;
            int main()
            {
            	cin >> n;
            	for (int i = 1; i <= n; i += 3)
                {
            		cout << i << endl;
            	}
                return 0;
            }
            
            • 1

            【入门】输出满足条件的整数3

            信息

            ID
            710
            时间
            1000ms
            内存
            16MiB
            难度
            1
            标签
            递交数
            150
            已通过
            104
            上传者