Chinaunix首页 | 论坛 | 博客
  • 博客访问: 26122
  • 博文数量: 41
  • 博客积分: 185
  • 博客等级: 入伍新兵
  • 技术积分: 260
  • 用 户 组: 普通用户
  • 注册时间: 2012-12-20 13:48
文章分类

全部博文(41)

文章存档

2013年(20)

2012年(21)

我的朋友
最近访客

发布时间:2013-02-01 23:00:36

java中double类型变量保留小数问题大体分两种情况:(一):小数点后面位数过长,四舍五入保留指定位数:可以用以下代码实现:public class TestDemo { public static void main(String[] args) {     double a=15.3274.........【阅读全文】

阅读(230) | 评论(0) | 转发(0)

发布时间:2013-01-09 12:39:54

方法一:利用"swith"语句 点击(此处)折叠或打开 //输入一个日期,如“2013 8 8”,输出该日期是当年第几天。 #include"stdio.h" void main() {     int year,month,day,sum,leap;     sum=0;     printf("input the date:");     scanf("%d%d%d",&year,&......【阅读全文】

阅读(135) | 评论(0) | 转发(0)

发布时间:2013-01-08 09:50:23

文件打开关闭函数:fopen()和fclose() <FILE *fopen(char *filename, char *mode)| int fclose(FILE *fp)>字符读写函数 :fgetc()和fputc()<int fgetc(FILE *fp)|int fputc(int ch, file *fp)> 字符串读写函数:fgets()和fputs()<char *fgets(char *str, int num, FILE *fp)| int fputs(char *str, file *fp)> 数据块读写函数:fread()和fwr......【阅读全文】

阅读(209) | 评论(0) | 转发(0)

发布时间:2013-01-07 15:58:36

点击(此处)折叠或打开 //数组-折半查找法 #include"stdio.h" #define N 10 int main(void) {     int a[N],i,j,low,high,mid,num,temp,found;     char choice;     printf("Please enter %d integers:",N);     for(i=0;i<N;i++......【阅读全文】

阅读(138) | 评论(0) | 转发(0)

发布时间:2013-01-06 22:43:39

点击(此处)折叠或打开 /*带头结点的单向链表操作*/ /*核心:pre=head(pre为前驱结点)*/ /*为方便,结构体只定义一个数据*/ #include"stdio.h" #include"stdlib.h" typedef struct Student {     int num;     struct Student *next; }Stu; //建立链表 Stu *Creat() {     Stu *p......【阅读全文】

阅读(405) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册