![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
前
Little_AOA_Plane
懒惰人的坚持
展开
-
编程中的数值与对应符号的处理
元素成员交换数值计算neich原创 2014-08-27 20:46:11 · 578 阅读 · 0 评论 -
C语言21
1216#include #include int binom (int n, int i);//第二个参数为指数,第一个为第几个参数//void main (void) { int int1;int int2;//打印两项式 printf ("NOTE: Entering a figure other than a number will \转载 2014-12-16 22:24:03 · 627 阅读 · 0 评论 -
c语言的缓冲区
缓冲区是代码与屏幕输出联系的一个niu原创 2014-08-17 22:41:35 · 388 阅读 · 0 评论 -
c语言思想21
#include #include #include #define MAX 50int cycle(char *s)//回文判定{char *h,*t;for(h=s,t=s+strlen(s)-1最高下标;t>h[两个地址的比较(把指针当成下标)];h++,t--)if(*h!=*t) break;return t}main(){ch转载 2014-10-26 00:22:24 · 402 阅读 · 0 评论 -
变量的值在不同的作用域
#includeint f=1 int ft()原创 2014-08-19 22:54:56 · 436 阅读 · 0 评论 -
c prime plus的笔记
11c语言scanf遇到第一个blank tab newline后停止转换语句后要说明printf("%010.2f",ss)0为一个标志填充字段打印较长字符串 printf有返回值检查错误分两行代码 orprintf( \)or printf("""")字符串读进数组不用&%*d滞后赋值 scanf("%*d %*d %d",&原创 2014-11-05 00:25:29 · 1265 阅读 · 0 评论 -
c语言思想20
/*字符串的所有字符排列函数,用已知字符串s中的所有字符,生成由其中n个字符组成的所有字符排列 */#include#include#define N 20char w[N];perm(int n, char *s){char s1[N];int i;if(nprintf("%s\n",w); /* 一个排列生成输出 */else{strcpy(转载 2014-10-26 00:21:08 · 341 阅读 · 0 评论 -
c语言对于文件的收藏
#include #include main(){char fname[80];/*存贮文件名*/FILE *rfp;long count;/*文件字符计数器*/system("cls");printf("Please input the file's name:\n");scanf("%s",fname);if((rfp=fopen(fname,"转载 2014-10-31 22:58:28 · 438 阅读 · 0 评论 -
c语言选择排序
#include #define MAX 255int R[MAX];void Select_Sort(int n){ int i,j,k; for(i=1;i {/* 做第i趟排序(1≤i≤n-1) */ k=i; for(j=i+1;j if(R[j] k=j; /* k记下目前找到的最小关键字转载 2014-11-14 23:31:48 · 717 阅读 · 0 评论 -
对C语言代码整理
整理目录如下=============================§ §§ CodeReadme 文件 §§转载 2015-01-27 22:52:10 · 1413 阅读 · 1 评论 -
计算器
#include#includeint main(){int i,j;int sum=0;char a;printf("请输入数:\n");scanf("%d%c%d",&i,&a,&j);switch(a){ case '+':{sum=i+j;break;}case '-' :{sum=i-j;brea原创 2014-08-19 23:03:44 · 365 阅读 · 0 评论 -
c语言明解查看文件的详细代码
FILE转载 2014-08-27 20:30:56 · 441 阅读 · 0 评论 -
notepad++下编译c
cmd /k ""C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" x86 && XX&& cd $(CURRENT_DIRECTORY) && cl /EHsc $(FULL_CURRENT_PATH) && cmd /k $(CURRENT_DIRECTORY)\$(NAME_PART).exeXX代表的是程原创 2015-03-24 23:11:32 · 464 阅读 · 0 评论 -
关于比较前后元素大小超时
//#include"stdafx.h"#include#include#include#include#includeusing namespace std;int main(){ freopen("test.txt","r",stdin); //if(fseek(stdut,100L,0))freopen("out.txt","w",stdo原创 2015-03-30 23:46:53 · 380 阅读 · 0 评论 -
冒泡
#include #include #include #define N 5#define SCORES 5#define NUMLEN 10struct std_type{char no[NUMLEN];/*学号*/char *name;/*名字符串指针*/int scores[SCORES];/*五门功课的成绩*/};struct std_type转载 2014-11-01 23:30:57 · 425 阅读 · 0 评论 -
c简单编译过程(vs2010)
此文件名最好用cpp结尾,不然把该注释的地方注释,定义变量时记得放在main()内freopen前目录下test.txt用于输入测试数据,out.txt输出ps:用到vs2010的命令提示工具(开始----所有程序 -----------vs2010全称-------带Tools字样---64位就选兼容吧)//#include"stdafx.h" #include//#inc原创 2015-03-10 23:26:00 · 570 阅读 · 0 评论 -
哨兵排序
#include #define MAX 255int R[MAX];void Insert_Sort(int n)哨兵是为了不越界,数组下标越界跟指针指错地方一样{ /* 对数组R中的记录R[1..n]按递增序进行插入排序 */ int i,j; for(i=2;i if(R[i] {/* 若R[i]大于等于有序区中所有的R,转载 2014-11-09 23:51:53 · 1989 阅读 · 0 评论 -
case的用法
由于case无法判断布尔值,因此只能够将判断条件提前,符合条件的可以进行赋值,如果是用于数据范围的判断最好使用其他条件判断类型原创 2015-03-20 00:01:56 · 759 阅读 · 0 评论 -
某本c语言书
貌似没听过或者忘了,,十进制数转化为shijingz转载 2014-08-25 22:07:16 · 363 阅读 · 0 评论 -
assert.h
可能是c语言里最鸡肋的头文件原创 2014-08-18 22:41:40 · 392 阅读 · 0 评论 -
ctype.h
主要提供两类重要的函数:字符测试函数和字符大小转化函数。提供的函数中都以int类型为参数,并返回一个int类型的值。实参类型应该隐式转换或者显示转换为int类型。 int isalnum(int c); 判断是否是字母(8)或数字(0)。 int isalpha(int c); 判断是否是字母(1024)。0 int iscntrl(int c); 判断是否转载 2014-08-18 22:55:07 · 573 阅读 · 0 评论 -
c语言的程序
#include #define MAX 50/* 函数rep实现对s中出现的s1中的字符替换为s2中相应的字符 */rep(char *s,char *s1,char *s2){char *p;for(;*s;s++)/*顺序访问字符串s中的每个字符*/{for(p=s1;*p&&*p!=*s;p++);/*检查当前字符是否在字符串s1中出现*/if(转载 2014-10-11 23:19:18 · 517 阅读 · 0 评论 -
学生成绩管理
/*学生成绩管理程序编制一个统计学生考试分数的管理程序。设学生成绩已以一个学生一个记录的形式存储在文件中,每位学生记录包含的信息有:姓名,学号和各门功课的成绩。程序具有以下几项功能:求出各门课程的总分,平均分,按姓名,按学号寻找其记录并显示,浏览全部学生成绩和按总分由高到低显示学生信息等。*/#include #include #define SWN转载 2014-11-09 23:55:58 · 1232 阅读 · 1 评论 -
C语言思想5
#include main(){int i,j,n;long sum=0,temp=0;printf("Please input a number to n:\n");scanf("%d",&n);if(n{printf("The n must no less than 1!\n");return;}@for(i=1;i{te原创 2014-07-09 20:22:05 · 829 阅读 · 0 评论 -
c语言思想3
/* Input two numbers, output the product */#include main(){int x,y,m; 给三个内存中的空位置命名printf("Please input x and y\n");提示你输入函数的参数,相当于界面scanf("%d%d",&x,&y);获取函数的参数,你用键盘中输入的东西,可能需要经历两种类型的转原创 2014-07-07 21:08:05 · 397 阅读 · 0 评论 -
c语言思想12
#includerest(int a[], int n){int i,low,high,t;for(i=0,low=0,high=n-1;i{if(a[i]>0){/*a[i]与a[high]交换,随之high减1*/t=a[i];a[i]=a[high];a[high]=t;high--;}else if(a[i]==0)原创 2014-07-25 20:43:28 · 412 阅读 · 0 评论 -
c语言思想11
#include "stdio.h"long int f(int year,int month){/*f(年,月)=年-1,如月if(monthelse return year;}long int g(int month){/*g(月)=月+13,如月if(monthelse return month+1;}long int n(原创 2014-07-25 20:39:06 · 519 阅读 · 0 评论 -
关于c语言的想法探究2(新手,给自己看的)
三个文件实现Helloword文件名:print.h 创建了一个小环境#include "stdio.h" 没有大环境基础不行void(函数的结果的类型-。-一般叫返回值) printHello(void(输入参数即未知数x的类型)); c99标准下的函数(在这个环境中只有这一个不同于大环境函数)=========================文件名原创 2014-07-06 21:19:55 · 576 阅读 · 0 评论 -
c语言思想10
#define N 50main(){int primes[N];int pc,m,k;system("cls");printf("\n The first %d prime numbers are:\n",N);primes[0]=2;/*2是第一个质数*/pc =1;/*已有第一个质数*/m =3;原创 2014-07-24 21:33:17 · 437 阅读 · 0 评论 -
关于c语言的想法探究1(新手,给自己看的)
/* The first C programme */ 标准的注释,对文件的说明#include(英文:包括) (英文:h=head) 引用这个文件中,相当于找一个使用这种语言的环境,没有这个环境,话语毫无意义main()(英文:主要) 编程中所谓的算法,一个函数{printf("Hello World!\n");旧时代的打印,新时代的输出,你能看到的。“”这两个东原创 2014-07-05 20:57:05 · 517 阅读 · 0 评论 -
c语言思想9
#define MAXN 20#includemain(){ int a[MAXN][MAXN];int min, max; int row,col,n;system("cls");printf("Please input the order of the matrix:\n");/* 输入方阵的阶次 */scanf("%d",&n原创 2014-07-23 20:54:04 · 365 阅读 · 0 评论 -
c语言思想8
/* 用二维数组实现矩阵的转置 */#include #include#define ROW 3#define COL 4main(){int matrixA[ROW][COL],matrixB[COL][ROW];int i,j;system("cls");printf("Enter elements of the matrixA,");pri原创 2014-07-23 20:48:53 · 418 阅读 · 0 评论 -
C语言数据结构书顺序表手打
#include#include#define MAXSIZE 100 //定义顺序表的最大容量#define ElemType int //定义顺序表存储的类型,可自行设置//顺序存储结构的线性表的类型typedef struct{ ElemType elem[MAXSIZE]; //存放线性表的数组 int length; //length是线性表的转载 2014-07-31 19:55:17 · 691 阅读 · 0 评论 -
c语言思想4
貌似输出几个##include main(){char ch,nch; 定义字符型ch,nchint count; 存数用的int k; 计数用的· printf("Please input a string with a # in the end.\n"); 界面格式要求X# 这里的x只是0到9 scanf("%c",&ch);把数字x弄原创 2014-07-09 20:20:14 · 429 阅读 · 1 评论 -
c语言思想13
#includeint a[]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};main(){int i;system(“cls”);printf("\n The arry is:\n");for(i=0;iprintf(" %d ",a[i]);printf("\n SUM of the arry is: %d\n",sum(a,s原创 2014-07-29 21:20:58 · 340 阅读 · 0 评论 -
c语言思想19
#include #define MAX 20int search(int *apt,/*已知数表的首元指针*/int n,/*数表中元素个数*/int key)/*要寻找的值*/{int *p;for(p=apt;pif(*p==key)return p-apt;/*返回找到元素的下标*/return -1;}int *find(int *apt,原创 2014-08-17 22:53:17 · 508 阅读 · 0 评论 -
c语言思想18
int a[]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};main(){ int i; clrscr(); printf("\n The arry is:\n"); for(i=0;i<sizeof(a)/sizeof(a[0]);i++) printf(" %d ",a[i]); printf("\n SUM of the arry is: %原创 2014-08-16 22:40:22 · 366 阅读 · 0 评论 -
c语言思想15
/* 函数circle用于判断正整数n的d进制数表示形式是否是回文数 */#include#iincludeint circle(int n, int d){int s=0,m=n;while(m) {s=s*d+m%d; while设计以将整数转化为0后跳出m/=d;}return s==n; 以回文数与原数的规律来判断返回结果为1原创 2014-08-15 19:37:13 · 373 阅读 · 0 评论 -
c语言思想17
main(){ int x,y,z; /* 定义三个int型变量 */ int *xp = &x, /* 定义指针变量xp,并赋值为x的地址,使xp指向x */ *yp = &y, /* 定义指针变量yp,并赋值为y的地址,使yp指向y */ *zp = &z; /* 定义指针变量zp,并赋值为z的地址,使zp指向z */ int t; clrscr(); prin原创 2014-08-16 22:22:14 · 431 阅读 · 0 评论 -
C语言思想14
/* 函数trans将无符号整数n翻译成d(2#include#include#define M sizeof(unsigned int)*8int trans(unsigned n, int d, char s[]){static char digits[] ="0123456789ABCDEF"; /* 十六进制数字的字符 */char buf[M+1];int原创 2014-08-08 21:44:06 · 397 阅读 · 0 评论