排序
【NOIP2012 普及组】质因数分解
题目描述 已知正整数 n 是两个不同的质数的乘积,试求出两者中较大的那个质数。 输入格式 输入一个正整数 n。 输出格式 输出一个正整数 p,即较大的那个质数。 样例 #1 样例输入 #1 21 样例输出...
【模拟】旋转矩阵
#include<stdio.h> int main(){ int n; scanf('%d',&n); int a[n][n]; int top=0,down=n-1,left=0,right=n-1,count=1; while(count<=n*n){ for (int i=left;i<=right;i++){ a[top]...
【C++】cpp-httplib研究链接
https://github.com/yhirose/cpp-httplib https://blog.csdn.net/qq_40344790/article/details/135246178 https://juejin.cn/post/7169574207632703519 https://www.bilibili.com/video/BV1Xt4y...
【C】交换,交换,交换!(指针&函数)
代码 #include<stdio.h> void swap(int *x,int *y){ int t; t=*x; *x=*y; *y=t; } int main(){ int a,b,*pa,*pb; pa=&a;pb=&b; scanf('%d %d',&a,&b); swap(pa,pb); printf('%d %d',...
【深基2.例12】上学迟到
题目描述 学校和 yyy 的家之间的距离为 s 米,而 yyy 以 v 米每分钟的速度匀速走向学校。 在上学的路上,yyy 还要额外花费 10 分钟的时间进行垃圾分类。 学校要求必须在上午 8:00 到达,请计算...
【C】使用函数递归实现二分查找数组最大值
#include <stdio.h> //二分查找最大值 int Max(int r[],int low,int high){ int mid,maxL,maxR; if (low==high){ return r[low]; } else{ mid=(high+low)/2; maxL=Max(r,low,mid); maxR=Max(...