C语言学习
文章平均质量分 61
咖啡酸梅汤
这个作者很懒,什么都没留下…
展开
-
2016年第七届蓝桥杯B组C/C++题解
2016年第七届蓝桥杯B组C/C++题解第一题煤球数目有一堆煤球,堆成三角棱锥形。具体:第一层放1个,第二层3个(排列成三角形),第三层6个(排列成三角形),第四层10个(排列成三角形),…如果一共有100层,共有多少个煤球?请填表示煤球总数目的数字。注意:你提交的应该是一个整数,不要填写任何多余的内容或说明性文字。分析:观察规律.第一层:1第二层:1 + 2第三层:1 + 2 + 3第四层:1 + 2 + 3 + 4累加1到100层,两层for循环可解我的答案:17原创 2021-04-14 10:42:52 · 269 阅读 · 0 评论 -
刷题笔记LeetCode35:搜索插入位置(C/C++)
给定一个排序数组和一个目标值,在数组中找到目标值,并返回其索引。如果目标值不存在于数组中,返回它将会被按顺序插入的位置。你可以假设数组中无重复元素。示例 1:输入: [1,3,5,6], 5输出: 2示例 2:输入: [1,3,5,6], 2输出: 1示例 3:输入: [1,3,5,6], 7输出: 4示例 4:输入: [1,3,5,6], 0输出: 0分析:把问题分解,如题所给实例,有四种可能的结果:target=nums中的值。如示例1target插入nums某个数之中原创 2021-01-01 12:07:48 · 112 阅读 · 0 评论 -
1003 Emergency (25分)
1003 Emergency (25分)As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams i...原创 2020-03-25 21:33:36 · 107 阅读 · 0 评论 -
1002 A+B for Polynomials(多项式的加法)
1002 A+B for Polynomials (25分)This time, you are supposed to find A+B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and e...原创 2020-03-23 16:43:10 · 263 阅读 · 0 评论 -
A1001 A+B Format
1001 A+B Format (20分)Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits).Input Specifi...原创 2020-03-22 15:47:12 · 167 阅读 · 0 评论 -
#怎样建立一个简单的链表
C/C++学习笔记怎样建立一个简单的链表单头链表源程序:#include<stdio.h>#include<stdlib.h>typedef struct Node//节点定义 { int data; struct Node* next;}*p_node;typedef struct head //表头定义{ p_node root;};vo...原创 2019-11-28 17:46:22 · 157 阅读 · 0 评论