随笔分类 - C
摘要:// 学生信息录入系统2.0 #include<stdio.h>#include<string.h>#include<stdlib.h>#include<time.h>#include<conio.h>#include<Windows.h>#include<process.h> #define Ma
阅读全文
摘要:#include<stdio.h> //stdio.h 头文件定义了三个变量类型、一些宏和各种函数来执行输入和输出#include<stdlib.h> //stdlib .h 头文件定义了四个变量类型、一些宏和各种通用工具函数#include<windows.h> // 获取控制台窗口句柄 微软官方
阅读全文
摘要:#include<stdio.h>#include<string.h>void fsort(char*color[],int n);int main(){ int i; char*pcolor[]={"red","blue","yellow","green","black"}; fsort(pcol
阅读全文
摘要:#include<stdio.h>int main(int argc,char*argv[]){ int k; for(k=1;k<argc;k++){ printf("%s",argv[k]); } printf("\n"); return 0;}
阅读全文
摘要:#include<stdio.h>int main(){ int i; char*poem[4]={"一叶轻舟向东流,","帆梢轻握杨柳手,","风纤碧波微起舞,","顺水任从雅客悠。"}; char mean[10]; for(i=0;i<4;i++){ mean[2*i]=*(poem[i]);
阅读全文
摘要:#include<stdio.h>int main(){ int a=10; int *p=&a; int **pp=&p; printf("a=%d *p=%d **pp=%d\n",a,*p,**pp); printf("&a=%d p=%d *pp=%d\n",&a,p,*pp); print
阅读全文
摘要:#include<stdio.h>void fsort(int a[],int n);int main(void){ int i; int a[5]={6,5,2,8,1}; fsort(a,5); for(i=0;i<5;i++){ printf("%d",a[i]); } return 0;}v
阅读全文
摘要:#include<stdio.h>#include<string.h>int main(){ int i; char *color[5]={"red","blue","yellow","green","black"}; char str[20]; printf("Input a color:");
阅读全文
摘要:#include<stdio.h>#include<math.h>#define PI 3.141592654void cal(int sel);double vol_ball(void);double vol_cylind(void);double vol_cone(void);int main(
阅读全文
摘要:#include<stdio.h>#define Mile_to_meter 1609 //1英里等于1609米 #define Foot_to_centimeter 30.48 //1英尺=30.48厘米 #define Inch_to_centimeter 2.54 //1英寸=2.54厘米 i
阅读全文
摘要:#include<stdio.h>void hanio(int n,char a,char b,char c);int main(){ int n; printf("input the number of disk:"); scanf("%d",&n); printf("the steps for
阅读全文
摘要:#define Mile_to_meter 1609 //1英里等于1609米 #define Foot_to_centimeter 30.48 //1英尺=30.48厘米 #define Inch_to_centimeter 2.54 //1英寸=2.54厘米
阅读全文
摘要:#include<stdio.h>#define MAX(a,b) a>b?a:b#define SQR(x) x*xint main(void){ int x,y; scanf("%d%d",&x,&y); x=MAX(x,y); y=SQR(x); printf("%d %d\n",x,y);
阅读全文
摘要:#include<stdio.h>#include"length.h"int main(){ float foot,inch,mile; printf("Input mile,foot and inch:"); scanf("%f%f%f",&mile,&foot,&inch); printf("%
阅读全文
摘要:#include<stdio.h>double fact(int n);int main(){ int n; scanf("%d",&n); printf("%f",fact(n)); return 0;} double fact(int n){ double result; if(n==1||n=
阅读全文
摘要:#include<stdio.h>struct student { int num; char name[10]; int computer,english,math; double average;};int main(){ int i,index,j,n; struct student stud
阅读全文
摘要:#include<stdio.h>struct student { int num; char name[10]; int computer,english,math; double average;};int update_score(struct student *p,int n,int num
阅读全文
摘要:#include<stdio.h>struct student { int num; char name[10]; int computer,english,math; double average;};int main(){ int i,n; struct student s1,max; prin
阅读全文
摘要:#include<stdio.h>void swap1(int x,int y),swap2(int *px,int *py),swap3(int *px,int *py);int main(){ int a=1,b=2; int *pa=&a,*pb=&b; swap1(a,b); printf(
阅读全文
摘要:#include<stdio.h>int main(){ int a[2],*p,*q; p=&a[0]; q=p+1; printf("%d\n",q); printf("%d\n",p); printf("%d\n",q-p); printf("%d\n",*q-*p); return 0;}
阅读全文