- 博客(24)
- 收藏
- 关注
原创 火爆的一乐面馆
#include#define MAX 10int main(){ int lieshu,i,j; double lamiantime,kaoroutime,yinliaotime,time,temp; double timetotal[MAX]; char str[MAX][18]; printf("请输入现在队伍的列数:\n"); scanf("%d",&lieshu); if(lieshu>
2015-01-19 14:02:44 1026
原创 最小公倍数
#includeint main(){ int a,b,k,t,i; printf("Please input a and:"); scanf("%d %d",&a,&b); if(a>1000||a1000||b<=0) { printf("Output:\nInput error!\n"); return 0; } else { if(a<b) { k
2015-01-19 12:07:32 560
原创 读取字符并校验和
#includeint main(){ int line=0; int at_beginning=1; char ch; signed char checksum= -1; while((ch = getchar()) != EOF) { if(at_beginning == 1) { line += 1; at_beginning = 0; printf
2015-01-19 12:06:22 463
原创 最大公约数
#includeint main(){ int a,b,k,i; printf("Please input a and:"); scanf("%d %d",&a,&b); if(a>1000||a1000||b<=0) { printf("Output:\nInput error!\n"); return 0; } else { if(a<b) { k=a
2015-01-17 19:19:21 412
原创 指针的应用
#includeint main(){ char a[10]={'1','2','3','4','5','6','7','8','9',0},*p; int i; i=8; p=a+i; printf("%s %s\n",p-3,a); return 0;}
2015-01-17 18:45:11 342
原创 指针的简单比较
#includevoid Jiaohuanzhi1(int a,int b);void Jiaohuanzhi2(int *x,int *y);int main(){ /*int a,b,*x,*y; printf("请输入a,b的值:"); scanf("%d %d",&a,&b); x=&a; y=&b; Jiaohuanzhi1(a,b); printf("a=%d,b
2015-01-17 18:40:59 461
原创 指针变量作为函数参数实现对输入的两个整数按大小顺序输出
#includevoid swap(int *p1,int *p2);int main(){ int a,b; int *pointer_1,*pointer_2; printf("please enter a and b:"); scanf("%d,%d",&a,&b); pointer_1=&a; pointer_2=&b; if(a<b) swap(pointer_1
2015-01-17 18:39:20 3567
原创 线性链表的建立与显示
#include#includetypedef int ElemType;typedef struct Node{ ElemType data; struct Node*next;}LNode;void createLinkList(LNode*head);void displayLinkList(LNode*head);int main(){ LNode*head; h
2015-01-17 18:35:24 539
原创 显示相对应的图案
#includevoid Print(int num,int kong,int MAX);void Printdown(int num,int kong);void KongGe(int num);int main(){ int num,kong,MAX; while(MAX!=0) { num=0,kong=0; printf("Please input a number
2015-01-17 18:32:38 466
原创 显示菱形改
#includevoid KongGe(int n,int i);void print(int i,int n,int k);void printDown(int i,int n,int k);int main(){ int i,n,k=0; /*while(n!=0) { if(n==1) { printf("Enter Error!\n"); return
2015-01-17 18:28:22 523
原创 显示菱形
#includevoid KongGe(int n,int i);int main(){ int i,n,k=0; while(n!=0) { if(n==1) { printf("Enter Error!\n"); return 0; } printf("Please input n: "); scanf("%d",&n); for(i=0;i<n
2015-01-17 18:26:22 487
原创 四舍五入
#includeint main(){ double num; int n; while(num!=0) { printf("Please input num and n:"); scanf("%lf %d",&num,&n); printf("Output:\n%.*lf\n",n,num); } return 0;}
2015-01-17 18:24:57 401
原创 求一元二次方程的根
#include#includeint main(){ void t1(int a,int b,int c); void t2(int a,int b,int c); void t3(int a,int b,int c); int a,b,c,delta; double ans0,ans1,sqrt_delta,realpart,imagpart; printf("Please
2015-01-17 18:23:48 541
原创 数字分解成质因数
#includeint main(){ int num,i; while(num!=0) { printf("Input a number: "); scanf("%d",&num); printf("%d=",num); for(i=2;i<num;i++) { while(num!=i) { if(num%i==0) { pr
2015-01-17 18:19:44 615
原创 数列求和
#includeint Fuhao(i);int main(){ int i,n; double total=0; printf("Please input n:"); scanf("%d",&n); if(n=1000) printf("Input error!\n"); else { for(i=1;i<=n;i++) total+=Fuhao(i)*(dou
2015-01-17 18:18:31 482
原创 输入月份显示多少天
#includeint main(){ int month,day; printf("输入您想知道的月份天数:\n"); scanf("%d",&month); while(month>=1&&month<=12) { switch(month) { case 1:case 3:case 5:case 7:case 8:case 10:case 12: day=31
2015-01-17 18:17:08 654
原创 输入任意一点坐标,求建筑高度
#includeint main(){ int x1=2,y1=2,x2=-2,y2=2,x3=2,y3=-2,x4=-2,y4=-2; double x,y; printf("请输入x和y的值:"); scanf("x=%lf,y=%lf",&x,&y); if(((x-x1)*(x-x1)+(y-y1)*(y-y1))<=1) { printf("建筑高度为10m\n");
2015-01-17 18:16:16 958
原创 判断是否闰年
#includeint main(){ int year; while(year!=0) { printf("Input a year: "); scanf("%d",&year); if(year%100==0) { if(year%400==0) printf("%d is leap year.\n",year); else printf(
2015-01-17 18:14:02 417
原创 牛顿迭代法求方程的根
#include#includedouble Resolve(double a,double b,double c,double d);double f(double x,double a,double b,double c,double d);double f1(double x,double a,double b,double c);int main(){ double a,b,
2015-01-17 18:12:26 634
原创 卡布列克常数
#includeint count=0;void vr6174(int num);void parse_sort(int num,int *each);void max_min(int *each,int *max,int *min);int main(){ int n; printf("Please input n: "); scanf("%d",&n); printf("O
2015-01-17 18:11:46 1887 2
原创 静态局部变量求阶乘
#includeint main(){ int fun(int n); int i,n; printf("Please input n: "); scanf("%d",&n); printf("Output:\n"); for(i=1;i<=n;i++) { printf("%d!=%d\n",i,fun(i)); } return 0;}int fun(int n)
2015-01-17 18:10:35 1103
原创 进制转化
#includeint main(){ int num; printf("Please input a number:"); scanf("%d",&num); if(num<0) printf("-%o -%x\n",-num,-num); else printf("%o %x\n",num,num); return 0;}
2015-01-17 18:08:52 415
原创 火爆的一乐拉面
#include#define MAX 10int main(){ int lieshu,i,j; double lamiantime,kaoroutime,yinliaotime,time,temp; double timetotal[MAX]; char str[MAX][18]; printf("请输入现在队伍的列数:\n"); scanf("%d",&lieshu);
2015-01-17 18:07:14 1187
原创 输入任意一点坐标,求建筑高度
#includeint main(){ int x1=2,y1=2,x2=-2,y2=2,x3=2,y3=-2,x4=-2,y4=-2; double x,y; printf("请输入x和y的值:"); scanf("x=%lf,y=%lf",&x,&y); if(((x-x1)*(x-x1)+(y-y1)*(y-y1))<=1) { printf("建筑高度为10m\n");
2015-01-17 16:22:45 1245
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人