C语言与数据结构习题
靳红军的博客
正经人
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C和指针5.9.1
/*大写输入转为小写输出*/ #include <stdio.h> #include <stdlib.h> //#include <ctype.h>int main() { int c; c=0; while( ( c = getchar() ) != EOF ) { //第一种 //putchar( tolower( c ) );原创 2017-08-25 23:16:00 · 189 阅读 · 0 评论 -
C和指针第八章的两个简单代码
第五题其实也写了,但是不对所以不想贴了,矩阵运算实在使人头疼//计算税收。以前觉得好像只能if实现,原来也可以这样 #include <stdio.h> #include <stdlib.h> float stax( int money); static double income_limits[]={0, 23350, 56550, 117950, 256500}; static float ba原创 2017-08-31 14:57:47 · 334 阅读 · 0 评论 -
第七章的两个题
#include <stdio.h> #include <stdlib.h> #include <math.h> /*厄密多项式计算*/ int HM( int n, int x); int main() { int jj; jj=HM( 3, 2 ); printf("值是%d!\n", jj); return 0; } int HM( int n, int x)原创 2017-08-31 15:00:36 · 263 阅读 · 0 评论 -
C和指针第七章的两个题
#include <stdio.h> #include <stdlib.h> int asctoint(char * str); int main() { char a[7]; int t; printf("输入字符 \n"); gets(a); t = asctoint(a); printf("转换后的值%d\n", t); //printf原创 2017-08-30 08:45:21 · 400 阅读 · 0 评论 -
C和指针 13章练习题算是从书上转载的吧
#include #include #include //计算从标准输入的几类字符的百分比,是书上的答案 int is_not_print( int ch )//避免了主循环处理特殊情况的需要 { return !isprint( ch); } //用于区分每种类型的分类函数的跳转表 static int ( *test_func[] )( int ) = { iscnt转载 2017-09-06 17:23:07 · 295 阅读 · 0 评论 -
C和指针习题4.14.1
/*计算近似平方值按照公式*/ #include <stdio.h> #include <stdlib.h>int main() { float n,a1=2,a2=1; printf("输入正数! "); scanf("%f",&n); if( n < 0 ) printf("输入出错\n"); while( ( a2-a1 ) != 0 )原创 2017-08-24 15:57:24 · 249 阅读 · 0 评论 -
C和指针 十二章 双链表没有实现
这一章主要讲了链表; 单链表和双链表,由于某些原因,只实现了单链表;双链表等我看到后边数据结构再回来补上去 #include #include //这段代码参考了c和指针以及深入浅出C语言程序设计链表一部分,但是插入元素的那段代码是深入浅出那里的,比较简单 typedef struct NODE { int value; struct NODE *link; } N原创 2017-09-05 20:58:34 · 233 阅读 · 0 评论 -
C和指针编程习题2.8.2待完善
/*检查一个C程序的话花括号对*/#include <stdio.h> #include <stdlib.h>int main() { char ch; int braces=0; while( (ch = getchar()) != EOF ) { if( ch == '{' )//左括号对的 { braces原创 2017-08-15 22:54:59 · 222 阅读 · 0 评论 -
C和指针第十一章的编程习题
写的偏向简单了,而且好像还理解错了题意,然而并不想改,因为课本后头有答案,#include #include int main() { // printf("Hello world!\n"); int *array,*p; int n_values; int i; printf("一共有几个数字?\n"); if(scanf( "%d", &n_value原创 2017-09-04 20:44:11 · 671 阅读 · 0 评论 -
C和指针第九章的四个小代码
#include <stdio.h> #include <stdlib.h> #include <string.h> //作用是将那个数字按照一定格式输出9_14_15 void dollars( char *dest,char const *src );int main() { char a[100]; char b[300]; printf("请输入数字\n");原创 2017-09-03 15:12:08 · 235 阅读 · 0 评论
分享