题目 1046: [编程入门]自定义函数之数字后移 摘要:解题思路:1:循环m次2:①每次先用t保存最后一个数,即a[n-1]②然后a[] 从末尾开始依次等于前一个数③让a[0]=t;4:输出a[];注意事项:参考代码:#include <stdio.h>v…… 题解列表 2021年12月29日 0 点赞 0 评论 296 浏览 评分:9.9
C++代码宏定义实参实现2个数字交换,最终实现3个数字的排序 摘要:解题思路:选择排序法注意事项:暂时不明参考代码:#include<iostream>using namespace std;#define swap(x,y) {int temp=x;x=y;y=te…… 题解列表 2021年12月28日 0 点赞 0 评论 189 浏览 评分:0.0
C++代码String库函数 摘要:解题思路:注意事项:暂时不明参考代码:#include<iostream>#include<string>using namespace std;int main(){ string origi…… 题解列表 2021年12月28日 0 点赞 0 评论 275 浏览 评分:0.0
C++函数,宏定义找3个数的最大数 摘要:解题思路:选择法排序if (a<b) a=b;if (a<c) a=c;return a;注意事项:暂时不明参考代码:#include<iostream>#include<iomanip>using …… 题解列表 2021年12月28日 0 点赞 0 评论 313 浏览 评分:0.0
C++代码用C++风格输出%6.2f格式的浮点数 摘要:解题思路:用C++风格输出%6.2f格式的浮点数https://blog.csdn.net/jal517486222/article/details/84591515注意事项:暂时不明参考代码:#in…… 题解列表 2021年12月28日 1 点赞 0 评论 534 浏览 评分:0.0
水仙花数简单 摘要:解题思路:注意事项:参考代码:a=int(input())sum=0k=afor i in range(0,4): sum+=(k%10)**3 k=k//10if sum==a: …… 题解列表 2021年12月28日 0 点赞 0 评论 244 浏览 评分:0.0
整除问题直接分离数字循环判断 摘要:解题思路:注意事项:参考代码:a=input()min=int(a.split()[0])max=int(a.split()[1])factor=int(a.split()[2])for i in r…… 题解列表 2021年12月28日 0 点赞 0 评论 229 浏览 评分:0.0
C++代码宏定义闰年判断 摘要:解题思路:四年一闰;百年不闰,四百年再闰if ((y%4==0) and (y%100!=0) or (y%400==0)) cout<<'L'<<endl;else cout<<&#…… 题解列表 2021年12月28日 0 点赞 0 评论 255 浏览 评分:0.0
数组查找和替换 摘要:解题思路:注意事项:参考代码:a=input()m=int(a.split()[0])n=int(a.split()[1])x=[]c=input().split()for i in range(0,…… 题解列表 2021年12月28日 0 点赞 0 评论 232 浏览 评分:0.0
C++代码带实参宏定义 摘要:解题思路:#define s(a,b,c) ((a+b+c)/2)#define area(a,b,c,s) sqrt(s(a,b,c)*(s(a,b,c)-a)*(s(a,b,c)-b)*(s(a,…… 题解列表 2021年12月28日 0 点赞 0 评论 285 浏览 评分:0.0