题解列表
1043三个数字的排序-换位法
摘要:**这里我主要讲一下第二种解法:换位法
这种方法的实现原理:我们的目标是在小房子a中存储最大的变量,小房子c中存储最小的变量,小房子b中存储次大的变量。
那么我们先对a和b进行比较 :如果a……
编写题解 1783: 星期判断机
摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ enum week{ Sun=0,Mon,Tues,Wed,Thurs,Fri,Sat} day; ……
开灯游戏(C语言代码)
摘要:```c
#include
int Switch(int n)
{
if (n == 0)
{
return 1;
}
else if (n == 1)
{
re……
斜率计算——python简单解法
摘要:解题思路:数学问题,y坐标之差除以x坐标之差注意事项:直线垂直于x轴的时候,斜率不存在参考代码:x1,y1=map(int,input().split())x2,y2=map(int,input().……
蓝桥杯算法提高VIP-最大乘积
摘要:#define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<……
1043: [编程入门]三个数字的排序
摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a,b,c; cin>>a>>b>>c; if(a>b){in……
注意剩余桃子和前一天桃子的关系式
摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int N,peach=0,peach_left=1; scanf("%d",&N); for(int i……
选择排序,通过一个个比较得出
摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(void){ int i,j,t; int a[10]; for(i=0;i<10……