奇偶数之和(题目的意思是包括n的) 摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main() { int n; scanf("%d",&n); int odd=0,even=0;//odd是…… 题解列表 2023年10月08日 0 点赞 0 评论 86 浏览 评分:0.0
奇数偶数和 摘要:解题思路: 用两次循环分别跑一遍奇数和与偶数和注意事项:参考代码: #include<stdio.h>int main(){ int m,i,j; int a=0,n=0; …… 题解列表 2023年03月11日 0 点赞 0 评论 90 浏览 评分:0.0
奇偶求和!!! 摘要:解题思路:选判断奇数和偶数,再加就行了注意事项:参考代码:#include<stdio.h>int main(){ int n,odd=0,even=0; scanf("%d",&n); …… 题解列表 2023年11月25日 0 点赞 0 评论 78 浏览 评分:0.0
奇偶数之和 摘要:解题思路:主要就是分别表示出奇数和偶数,我用k表示,如果k为奇数则i进行奇数相加,k为偶数则进行偶数的相加。注意事项:参考代码:#include<iostream>using namespace st…… 题解列表 2024年05月02日 0 点赞 0 评论 117 浏览 评分:0.0
3010 奇偶数之和 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int n,sum1=0,sum2 =0; cin>>…… 题解列表 2024年06月09日 0 点赞 0 评论 60 浏览 评分:0.0
运用公式计算 摘要:解题思路:本题运用了数学公式进行直接计算,避免了使用循环,从而显著降低了在 n 较大时可能导致的时间超限问题。公式能够在常数时间内完成计算,提升了效率。同时根据输入 n 的奇偶性,分别使用不同的公式来…… 题解列表 2024年09月16日 0 点赞 0 评论 60 浏览 评分:0.0
奇偶数之和 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int i,n,s=0,t=0; scanf("%d",&n); for(i=0;i<=n;i…… 题解列表 2022年12月25日 0 点赞 0 评论 145 浏览 评分:0.0
奇偶数之和 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int n,a=0,b=0; cin>>n; …… 题解列表 2023年07月01日 0 点赞 0 评论 159 浏览 评分:0.0
3010: 奇偶数之和 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int n,s=0,d=0; cin>>n; …… 题解列表 2024年06月09日 0 点赞 0 评论 83 浏览 评分:0.0
使用俩个for循环 摘要:解题思路:注意奇数是从1开始偶数从2开始注意事项:参考代码:#include<stdio.h>int main(){ int N,Sum1=0,Sum2=0; scanf("%d",&N)…… 题解列表 2023年02月08日 0 点赞 0 评论 116 浏览 评分:0.0