#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int PrintError = 0;
/*全局变量,0代表正常,1代表表达式出错*/
/*char类型链表式堆栈,用来存放运算符号,以及用在中缀表达式转换等时候*/
typedef struct Node *……继续阅读 »
9年前 (2016-04-10) 1033浏览
0个赞
C标准不允许重载函数,为什么在vs里面输入pow有多个重载函数可选,例如int类型,double类型等等. 它不是遵循C标准的吗?
解决方案
19
重载版只在C++中有效
2
VS 对 C 的支持,直到 VS2015 才好了一些。
19
引用:
Quote: 引用:
Quote: 引用:
Quote: 引用:
看来vs里面的智能提示功能不……继续阅读 »
9年前 (2016-04-10) 1315浏览
0个赞
#include<stdio.h>
int main()
{
int a,b;
scanf("%d,%d",&a,&b);
printf("%d\n",a+b);
return 0;
}
这个代码,本人输入1 2时,b就是乱码。
本人知道输入格式不对,但是具体为什么就不知道了,求高手
解决方案
10
……继续阅读 »
9年前 (2016-04-10) 1127浏览
0个赞
#include <stdio.h>
#include <stdlib.h>
char state = "a";
int i=0,j=0,xstate=0,Dstate[1][2]={{0,1}};
int floor[50][50]={0};
int direction( int m1);
int move(int n1,int ……继续阅读 »
9年前 (2016-04-10) 1385浏览
0个赞
一道关于大顶堆的题目,其中
空(3)(4)(5)
这几句作用是将新插入元素后的堆调整成大顶堆,其实就是不断将新插入的元素往上移,但是问题是,
前面已经定义了heapify()函数,有现成的调整大顶堆的函数了,为什么还要这么麻烦写这几句调整大顶堆的代码?
是原因是在这里有不得不这样做的原因吗?
解决方案
10
代码功能归根结底不是别人帮本人看或讲解或注释出来……继续阅读 »
9年前 (2016-04-10) 912浏览
0个赞
这是本人写的一篇关于计算星期几的C语言程序,但在计算(1945 8 15 星期三)(2001 7 12 星期四)等多个日期时出问题了
#include<stdio.h>
int main()
{
int year,month,day,ty,m,y,c,d,weeks;
scanf(“%d%d%d”,&year,&a……继续阅读 »
9年前 (2016-04-10) 1332浏览
0个赞
#include<stdio.h>
#include<stdlib.h>
typedef struct List //构建结构体
{ int coef;
int exp;
struct List *next;
}Node;
int Compare(int a,int b) //比较指数大小
{
if(a>b)
……继续阅读 »
9年前 (2016-04-10) 909浏览
0个赞
刚开始学指针疑问,为什么不用普通变量储存地址,要专门发明指针变量来储存呢?
解决方案
40
普通变量存储不了地址,例如你定义一个变量给他赋值一个看起来像地址的数据
const int a = 0x000000c0;
这时a只是等于这么一个十六进制的值,你无法操作0x000000c0这个地址的内存(当然,即使是指针,假如这么定义,你们无法修改这个地址中的数据)……继续阅读 »
9年前 (2016-04-10) 1490浏览
0个赞
使用c做的是一个二维四节点有限元程序,子函数需要返回一个4*4的矩阵,网上查询提示说需要使用指针变量,没有看明白,求高手帮助。
解决方案
20
仅供参考:
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
int **newarr2d(int rows,i……继续阅读 »
9年前 (2016-04-10) 1359浏览
0个赞