Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
106762 肖宋毅 12奇数和与偶数和 C++ Wrong Answer 1 MS 268 KB 523 2025-01-16 16:15:12

Tests(0/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,k,a=0,b=0,i; float sa=0,sb=0; cin>>n>>k; for(i=1;i<=n;i++) { if(i%k==0) { sa+=i; a++; } else { sb+=i; b++; } } return 0; }


Run Info:

------Input------
5 103
------Answer-----
2646 2700
------Your output-----