
算法
YLNF!!
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
贪心策略:acm 会场安排
#include<stdio.h> struct Job{ int begin,end; int flag;}; int manage(int n,Job *b){ int count=n,room=0,roomNum=0; while(count>0){ for(int i=1;i<=n;i++){ if((b[i].begin>roo...原创 2019-02-16 14:59:21 · 223 阅读 · 0 评论 -
简单的计算器(利用栈)
#include<stdio.h>#include<string.h>char judge[7][7]={'>','>','<','<','<','>','>', //定义优先级 '>','>','<','<','<','>','&a原创 2019-02-16 14:54:57 · 425 阅读 · 0 评论 -
链表应用:多项式的加减法
输入两个多项式输出这两个多项式的和或者差#include<stdio.h>#include<malloc.h>#include<stdlib.h>struct DuoXiangShi{ int XiShu; int Mi; int length; struct DuoXiangShi * next;};struct DuoXiangSh...原创 2019-02-14 10:20:55 · 724 阅读 · 0 评论 -
两个升序链表的合并算法
数据结构线性表的运用把两个升序链表合并成一个且不借助第三个链表代码如下:#include<stdio.h>#include<malloc.h>struct Data{ int index; struct Data * next;};struct Data * create(){ //创建升序链表 printf("请输入一个升序列表以0结束\n"...原创 2019-02-14 10:18:43 · 964 阅读 · 0 评论 -
北大ACM1723士兵排队问题
Soldiers N soldiers of the land Gridland are randomly scattered around the country. A position in Gridland is given by a pair (x, y) of integer coordinates. Soldiers can move - in one move, one so...原创 2019-02-12 11:43:42 · 665 阅读 · 0 评论 -
ACM经典题型,雷达找小岛
题目:Radar Installation (pku 1328)DescriptionAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea sid...原创 2018-09-16 15:32:12 · 912 阅读 · 0 评论 -
输入分子式,计算相对分子质量
#include<stdio.h>int t;int j=0;char *p;int function(char *string);int main(){ int a[t]; char string[t][100]; printf("请按格式输入\n"); scanf("%d",&t); for(int i=0;i<t;i++){ scanf...原创 2018-09-16 15:28:17 · 4943 阅读 · 0 评论 -
用C语言实现实数混合运算(带括号,不用栈)
之前在网上找了好多相似的文章,不过有的是功能不够,无法实现多级括号,有的是用到了栈,代码对于初学者来说不好理解。所以自己写了一个。不过不是完整代码,但是能够很好的解释这个逻辑#include<stdio.h>#include<string.h>char * symble(char *a);float mix(float *x,char *a);int div...原创 2018-09-16 15:23:54 · 4620 阅读 · 6 评论