77问答网
所有问题
当前搜索:
代码大全c语言
C语言
如何计算圆锥的体积和表面积
答:
下面是用
C语言
计算圆锥体积和表面积并保留三位小数的示例
代码
:include <stdio.h> include <math.h> define PI 3.1415926 // 定义圆周率常量 int main(){ double r, h; // 圆锥底面半径和高 double s, v; // 圆锥表面积和体积 printf("请输入圆锥底面半径和高(用空格分开):");scan...
用
C语言
编写一个有关顺序表的程序
代码
答:
printf("%c",L->elem[i]);printf("\n");} int ListLength(SqList *L) /* 求顺序表的长度 */ { return(L->length);} int ListEmpty(SqList *L) /* 求顺序表是否为空 */ { return(L->length==0);} int GetElem(SqList *L,int i,ElemType e) /*求顺序表中某个数据...
C语言
,线性表,插入,删除,合并的实现。要
源代码
,谢谢了。
答:
~刚好上学期数据结构老师非要叫写,还留了个~~include<stdio.h> int
c
=0;//
C
是用来计算数组中数的个数的,当下面插入时就c++;删除时就c-- void print(int a[100])//打印整个数组的函数 { int b;for(b=0;b<c;b++)printf("%d ",a[b]);printf("\n");} void cr(int a[])/...
c语言
如何编程求圆体积和表面积
答:
代码
如下:include <stdio.h> int main (){float h,r,l,s,sq,vq,vz;float pi=3.141526;printf("请输入圆半径r,圆柱高h∶");scanf("%f,%f",&r,&h); //要求输入圆半径r和圆柱高h sq=4*pi*r*r; //计算圆球表面积sq vq=3.0/4.0*pi*r*r*r; //计算圆球体积vq prin...
C语言
编程题 求
代码
答:
include "stdafx.h"include <iostream> include using namespace std;define M 10 define N 10 int main(){ int m, n,x;float num[M][N],min;cout << "请输入m、n的值:" << endl;cin >> m >> n;void output(float a[][10], int b, int c);float findmin(float a[][10...
C语言
简单四则混合运算
代码
答:
四则混合运算
代码
:include<stdio.h> include<ctype.h> include<stdlib.h> char token[61]; /*存放表达式字符串的数组*/ int n=0;void error(void) /*报告错误函数*/ { printf("ERROR!\n");exit(1);} void match(char expected) /*检查字符匹配的函数*/ { if(token[n]==expected)toke...
数据结构
代码
(用
C语言
) 单链表的插入和删除
答:
单链表功能
大全
,嘿嘿 include <stdio.h> include <stdlib.h> typedef struct node { int nDate;struct node *pstnext;}Node;//链表输出 void output(Node *head){ Node *p = head->pstnext;while(NULL != p){ printf("%d ", p->nDate);p = p->pstnext;} printf("\r\n");} /...
c语言
求圆柱体的表面积和体积
答:
1、
C语言
圆柱的表面积
源代码
如下:include <stdio.h> define p 3.14 void main(){ float s,r,h;printf("请输入圆柱的底面半径:");scanf("%f",&r);printf("请输入圆柱的高:");scanf("%f",&h);s= 2*p*r*h+2*p*r*r;printf("圆柱的表面积为:%f\n",s);} 2、C语言圆柱的...
一个合格的程序员应该读过哪些书
答:
原著第1版中介绍的
C语言
成为后来广泛使用的C语言版本——标准C的基础。人们熟知的“hello,world”程序就是由本书首次引入的,现在,这一程序已经成为所有程序设计语言入门的第一课。5、《算法导论》推荐数:671《
代码大全
》教你如何正确编程; 《人月神话》教你如何正确管理; 《设计模式》教你如何正确设计……在我...
用
c语言
写使用单链表建立一个简易商品库存表的程序
答:
按照你题意,
代码
如下:(你提问题没有用编程模板,我这里代码只能直接贴,原格式都没了,你只能自己排版了 。)(初始化数据的那段输入,只为演示,不要可以删除!)。include <stdio.h> include <malloc.h> include <string.h> include <conio.h> include <windows.h> typedef struct stock { ...
<涓婁竴椤
1
2
3
4
5
6
7
8
9
10
涓嬩竴椤
灏鹃〉
其他人还搜