c语言中双精度绝对值的函数 解题思路:计算浮点型绝对值使用fabs函数,原型:doublefabs(doublex)计算整数绝对值使用abs函数,原型:intabs(intx)计算长整型绝对值使用labs函数,原型:longlabs(longx)以题目为例,我们已经赋值x为双精度函数, 题解列表 2024年11月07日 0 点赞 0 评论 615 浏览 评分:0.0
3行解决,使用count计数函数 摘要:解题思路:用count函数读取空格数量,再存入变量b,在加1完成注意事项:参考代码:# 1505a = input()b = a.count(" ",0,len(a)) + 1print(b)…… 题解列表 2024年11月07日 0 点赞 0 评论 564 浏览 评分:9.9
2828: 与7无关的数 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int t=0,i,n,sum=0; scanf("%d",&n);…… 题解列表 2024年11月07日 0 点赞 0 评论 431 浏览 评分:0.0
数据结构用栈实现进制转换 摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <malloc.h>#define MAXSIZE 100typedef struct{ int data[MAXS…… 题解列表 2024年11月07日 0 点赞 0 评论 433 浏览 评分:0.0
循环链表解法(c语言代码) ```c#include#include//定义链表节点结构体typedefstructnode{intdata;//节点存储的数据structnode*next;//指向下一个节点的指针structnode*pre;//指向前一个节点的指针}linklist;//创建一个循环双向链表linklist 题解列表 2024年11月07日 1 点赞 0 评论 569 浏览 评分:0.0
小白,看看就行,不动脑袋 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cstdio>using namespace std;int main(){ int k, n; dou…… 题解列表 2024年11月07日 0 点赞 0 评论 408 浏览 评分:0.0
2831: 画矩形 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main() { int sum = 0, j, a, b, c, i; char d; scanf("%d…… 题解列表 2024年11月07日 0 点赞 0 评论 376 浏览 评分:0.0
信息学奥赛一本通T1173-阶乘和--运用高精度乘法与加法:计算n的阶乘和 摘要:解题思路:因为n<=50;当n>20最大存储整数类型long long也存储不下,导致造成数据溢出。所以运用高精度乘法与加法计算n的阶乘和参考代码:#include <iostream>#includ…… 题解列表 2024年11月07日 0 点赞 0 评论 737 浏览 评分:9.9
编写题解 2777: 计算2的幂 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int n,p=0; scanf("%d",&n); p=pow(2,n)…… 题解列表 2024年11月07日 0 点赞 0 评论 410 浏览 评分:9.9
T1267-01背包问题 摘要:解题思路:滚动数组—— 一维dp数组遍历:for( ) 物品 for( 逆序) 背包递推公式: dp[ j ] = max( dp[ j ] , dp[ j -w[ i ] ] + …… 题解列表 2024年11月07日 0 点赞 0 评论 437 浏览 评分:0.0