5 条题解

  • -1
    @ 2025-4-20 18:03:02

    f

    • -2
      @ 2025-2-12 16:07:22
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
      	int a,b=0,c=0;
      	cin>>a;
      	for(int i=1;i<=a;i++)
      	{
      		if(i%2!=0) b+=i;
      		else c+=i;
      	}
      	cout<<c<<" "<<b;
      }
      
      • -3
        @ 2025-4-20 18:02:40

        #include<bits/stdc++.h> using namespace std; int main() { int a,b=0,c=0; cin>>a; for(int i=1;i<=a;i++) { if(i%2!=0) b+=i; else c+=i; } cout<<c<<" "<<b; }

        //sha bi别抄题解!!!!!!!!!!!!!!!!!!!!!!!

        • -3
          @ 2025-4-20 18:00:47

          #include<bits/stdc++.h> using namespace std; int main() { int a,b=0,c=0; cin>>a; for(int i=1;i<=a;i++) { if(i%2!=0) b+=i; else c+=i; } cout<<c<<" "<<b; }//sha bi别抄题解!!!!!!!!!!!!!!!!!!!!!!!

          • -3
            @ 2024-11-17 10:58:14

            #include<bits/stdc++.h> using namespace std; int main() { int n,sum1,sum2,i; cin>>n; for(i=1;i<=n;i++) sum1+=i; i=1; while(i<=n) { sum2+=i; i+=2; } cout<<sum1<<' '<<sum2; return 0;//仅供参考 }

            • 1

            信息

            ID
            59
            时间
            1000ms
            内存
            256MiB
            难度
            6
            标签
            递交数
            30
            已通过
            12
            上传者