3010: 奇偶数之和(使用到for循环语句) 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(int argc, char *argv[]) { int n,i; int sum1=0,sum2=0…… 题解列表 2024年12月07日 0 点赞 0 评论 199 浏览 评分:10.0
c语言计算奇数偶数之和 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n; scanf("%d",&n); int x=0,y=0,i=1,d=2; while(i<=n){…… 题解列表 2022年11月13日 0 点赞 0 评论 733 浏览 评分:9.9
编写题解 3010: 奇偶数之和 摘要:解题思路:注意事项:注意要定义两个不同的sum!参考代码:#include<bits/stdc++.h>using namespace std;int main(){ long long n;cin>…… 题解列表 2024年12月08日 0 点赞 2 评论 202 浏览 评分:9.9
3010: 奇偶数之和题解 摘要:参考代码:#include<iostream>using namespace std;int main(){ int n,s=0,t=0; cin>>n; for(int i=1;i<=n…… 题解列表 2024年12月01日 1 点赞 0 评论 134 浏览 评分:9.9
编写题解 3010: 奇偶数之和 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int n,s=0,t=0; cin>>n; for(in…… 题解列表 2024年12月01日 3 点赞 1 评论 139 浏览 评分:9.9
遍历n中所有的i 偶数对二求余是0 奇数对二求余则是1 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(void){ int n,sum1=0,sum2=0; scanf("%d",&n);//输入n …… 题解列表 2024年11月03日 0 点赞 0 评论 104 浏览 评分:9.9
最短代码解决奇偶数之和 摘要:解题思路:使用求和公式。偶数求和公式为(n / 2) * (n / 2 + 1),奇数求和公式为(n / 2) * (n / 2)或(n / 2) * (n / 2)+n。注意事项:奇数和与偶数和求和…… 题解列表 2024年07月31日 0 点赞 0 评论 105 浏览 评分:9.9
编写题解 3010: 奇偶数之和 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;int main(){ int n…… 题解列表 2024年06月12日 0 点赞 0 评论 324 浏览 评分:9.9
3010 奇偶数之和 摘要:解题思路:循环1到n的所有数字, 判断奇偶数,分别求和,最后输出注意事项:sum1 需要使用+= 号 参考代码:#include <bits/stdc++.h>using namespace std…… 题解列表 2024年06月09日 0 点赞 0 评论 230 浏览 评分:9.9
java--study||O.o 摘要:参考代码:import java.util.Scanner; public class Main { public static void main(String[] args) …… 题解列表 2024年01月21日 0 点赞 0 评论 130 浏览 评分:9.9