c/c++
文章平均质量分 88
会悟
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Dijkstra算法 pat1030 Travel Plan
Description A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to decide the shortest path between his/her starting city and the destin原创 2021-02-22 00:40:59 · 230 阅读 · 0 评论 -
c/c++ 一条语句中包含多个i++时程序的运行情况
今天复习高精度时,遇到了个小坑,于是试验了下。 #include<iostream> using namespace std; int main() { int i = 1; int a[8] = {0, 1, 2, 3, 4, 5, 6, 7};//别忘从a[0]开始存数。 // a[++i] += 2; //# 1运行结果 i = 2 ...原创 2018-09-23 12:14:38 · 1454 阅读 · 0 评论 -
c++中cin输入与clt+z结束输入相关的问题
算是在编程中遇到的小插曲: 由while(cin >> a[t++]);作输入时,用clt+z结束输入时,会在数组末尾多录入一个0,于是在电脑上测试了下(环境window+dev) char c = 'b'; int a, b; cin >> b;//模拟while输入(先是几个正常输入),这里只输入并显示一个值。 cout <<...原创 2019-01-24 02:02:18 · 764 阅读 · 0 评论 -
c itoa函数的递归实现 及static小插曲
测试对静态变量声明及定义疑问同时,给出itoa函数(把整数转换为字符串)的实现。 #include<stdio.h> #include<math.h> #define MAXSIZE 100 char s[MAXSIZE]; void itoa1(int n, char s[])//该程序仅供测试静态声明,无法将负数正确转换 { //起初思想:若为负数,则初次声明后...原创 2019-08-08 15:56:26 · 356 阅读 · 0 评论
分享