- 博客(11)
- 资源 (3)
- 收藏
- 关注
原创 ss
#include "BigNum.h"#include //Download by http://www.codefans.netCBigNumber::CBigNumber(){ number=0; exponent=0;};CBigNumber::CBigNumber(float num){ number=num; exponent=0; Con
2013-05-13 23:17:45
481
原创 进制转换
//将16进制的一个字符转换为十进制的数unsigned char CConvNumsDlg::BtoH(char ch){ //0-9 if (ch >= '0' && ch return (ch - '0'); //9-15 if (ch >= 'A' && ch return (ch - 'A' + 0xA); //9-15
2013-05-08 23:58:16
570
原创 八进制转换为十进制
程序源代码:main(){ char *p,s[6];int n;p=s;gets(p);n=0;while(*(p)!='\0'){n=n*8+*p-'0';p++;}printf("%d",n);}
2013-05-08 23:33:58
1132
原创 连接两个链表
程序源代码:#include "stdlib.h"#include "stdio.h"struct list{ int data;struct list *next;};typedef struct list node;typedef node *link;link delete_node(link pointer,link tmp){if (tmp==NU
2013-05-08 23:32:42
752
原创 反向输出一个链表
程序源代码:/*reverse output a list*/#include "stdlib.h"#include "stdio.h"struct list{ int data; struct list *next;};typedef struct list node;typedef node *link;void main(){ link ptr,h
2013-05-08 23:32:06
1016
原创 创建一个链表
程序源代码:/*creat a list*/#include "stdlib.h"#include "stdio.h"struct list{ int data;struct list *next;};typedef struct list node;typedef node *link;void main(){ link ptr,head;int
2013-05-08 23:31:33
491
原创 有一个已经排好序的数组。现输入一个数,要求按原来的规律将它插入数组中
程序分析:首先判断此数是否大于最后一个数,然后再考虑插入中间的数的情况,插入后此元素之后的数,依次后移一个位置。程序源代码:main(){int a[11]={1,4,6,9,13,16,19,28,40,100};int temp1,temp2,number,end,i,j;printf("original array is:\n");for(i=0;i pr
2013-05-08 23:29:06
3330
1
原创 给一个不多于5位的正整数,要求:一、求它是几位数,二、逆序打印出各位数字
程序分析:学会分解出每一位数,如下解释:程序源代码:main( ){long a,b,c,d,e,x;scanf("%ld",&x);a=x/10000; /*分解出万位*/b=x%10000/1000; /*分解出千位*/c=x%1000/100; /*分解出百位*/d=x%100/10; /*分解出十位*/e=x%10; /*分解出个位*/if
2013-05-08 23:27:27
1614
原创 两个乒乓球队进行比赛,各出三人。甲队为a,b,c三人,乙队为x,y,z三人。已抽签决定比赛名单。有人向队员打听比赛的名单。a说他不和x比,c说他不和x,z比,请编程序找出三队赛手的名单
程序分析:判断素数的方法:用一个数分别去除2到sqrt(这个数),如果能被整除,则表明此数不是素数,反之是素数。 程序源代码:main(){char i,j,k; /*i是a的对手,j是b的对手,k是c的对手*/for(i='x';i for(j='x';j { if(i!=j) for(k='x';k { if(i!=k&&j!=k)
2013-05-08 23:26:18
1316
原创 判断101-200之间有多少个素数,并输出所有素数
程序分析:判断素数的方法:用一个数分别去除2到sqrt(这个数),如果能被整除,则表明此数不是素数,反之是素数。程序源代码:#include "math.h"main(){ int m,i,k,h=0,leap=1; printf("\n"); for(m=101;m { k=sqrt(m+1); for(i=2;i if(m%i==0)
2013-05-08 23:24:12
511
原创 题目:输入某年某月某日,判断这一天是这一年的第几天?
程序源代码:main(){int day,month,year,sum,leap;printf("\nplease input year,month,day\n");scanf("%d,%d,%d",&year,&month,&day);switch(month)/*先计算某月以前月份的总天数*/{ case 1:sum=0;break; case 2:sum=
2013-05-08 23:22:22
517
智慧旅游综合服务平台方案
2023-06-30
数字化转型下的智慧电厂探索与实践
2023-06-29
数字化交付赋能石化工程建设
2023-06-29
空间数据中台助力行业数字化转型
2023-06-29
用vc做的仿360界面
2012-11-26
解决TCP网络传输粘包问题
2012-11-07
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人