C语言-计负均正 解题思路:很常规的题目,输入数组,用for循环,然后if判断,小于0就计数+1,大于0也计数+1,排除0的可能,同时累加和。注意事项:注意输入,我当时怎么都不对,对照代码没问题的,发现是自己写错了输入,-5-6,输入-6输错了。参考代码:#includeintmain(){inta[ 题解列表 2023年02月05日 0 点赞 0 评论 840 浏览 评分:9.9
2798: 整数序列的元素最大跨度值 解题思路:注意事项:参考代码:a=int(input())n=list(map(int,input().split()))print(max(n)-min(n)) 题解列表 2023年02月05日 0 点赞 1 评论 659 浏览 评分:9.9
求[X,Y]内被除3余1并且被除5余3的整数的和 摘要:```c #include int main(){ int x,y; long long sum=0; scanf("%d%d",&x,&y); for(;x…… 题解列表 2023年02月05日 0 点赞 0 评论 525 浏览 评分:0.0
明明的随机数 摘要:```c #include int main(){ int n,a[100],i,j,cnt=0,t; scanf("%d",&n); for(i=0;i…… 题解列表 2023年02月05日 0 点赞 0 评论 626 浏览 评分:0.0
核电站问题 摘要:解题思路:注意事项:参考代码:try: while True: n=int(input()) lis = [1,2,4,7] for i in rang…… 题解列表 2023年02月05日 0 点赞 0 评论 602 浏览 评分:0.0
1027 题解 摘要:参考代码:#include<iostream> using namespace std; int add(int a,int b,int c) { if(a>b) { while(a%b!…… 题解列表 2023年02月05日 0 点赞 0 评论 388 浏览 评分:0.0
交换 a b 的值(不增加新的变量) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a,b; scanf("%d%d", &a, &b); a=a^b; b=a^b…… 题解列表 2023年02月05日 0 点赞 0 评论 658 浏览 评分:0.0
1043: [编程入门]三个数字的排序 摘要:解题思路:哔哔哔注意事项:bibibi参考代码:#include<iostream>using namespace std;int main(){ int a,b,c,x1,x2,x3,x4; …… 题解列表 2023年02月05日 0 点赞 0 评论 511 浏览 评分:2.0
向量点积计算(建立结构体) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>struct xy{ int a; int b;}spot[1000];int main(){ int n,sum=0; scanf("…… 题解列表 2023年02月05日 0 点赞 0 评论 548 浏览 评分:0.0
找第一个只出现一次的字符(代码简短) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int i,count[26]={0}; char str[100000]; gets(str); f…… 题解列表 2023年02月05日 0 点赞 0 评论 540 浏览 评分:0.0