ITeye博客

成长历程

xrtkong · 共 19 篇文章

课后习题4.3

/*Exercise 4.3 Displaying printable characters plus whitspace names */ #include <stdio.h> #include <ctype.h> int main(void) { int i = 0 ; char ch = 0; /* Character code value */ for( i = 0 ; i<128 ; i++) { ch = (char)i; if(ch%2==0) printf("\n"); printf(" %4d",ch); if(isgraph(ch)) printf(" %c",ch); …

2011-10-18 21:29 · 技术成长之路 · 评论(0)

课后习题4.2

/* isgraph();判断字符c是否为除空格外的可打印字符*/ #include<stdio.h> #include<ctype.h> int main(){ int i = 0 ; int j = 0 ;//判断打印出的个数 for(i = 0 ; i<=127 ; i++){ if(isgraph(i)){ //打印可打印字符 printf("%-3d-%c, ",i,i); //每十个字符一行 if(++j % 10 == 0) printf("\n"); } } printf("\n"); return 0 ; }

2011-10-18 19:34 · 技术成长之路 · 评论(0)

课后习题4.1

/*输入程序实现乘法表*/ #include<stdio.h> /*主函数,也是C语言程序的入口*/ int main(void){ int i = 0 ;//定义循环变量i int j = 0 ;//定义循环变量j int counter = 0 ;//定义输出表的数据 printf(" Please input the number you want , Dont forget the sapces !\n"); scanf(" %d", &counter); for( i = 1 ; i <= counter ; i++){ for( j = 1 ; j<= counter ; j++…

2011-10-18 19:11 · 技术成长之路 · 评论(0)

循环实例子:do while;while,for,伪bool型

注意:在C语言中,变量必须声明在函数开始的地方 #include<stdio.h> #include<ctype.h> #include<stdlib.h> #include<time.h> #define true 1 #define false 0 int main(){ char another_game ='Y' ; int correct = false; int counter = 0 ; int sequence_length = 0 ; time_t seed = 0 ; int number = 0 ; time_t now = 0 ; int time_taken = 0…

2011-10-17 23:57 · 技术成长之路 · 评论(0)

学习笔记习题3.4:goto 用法

#include<stdio.h> int main(){ char jx = 0 ; double number1 = 0.0 ; double number2 = 0.0 ; char op = 0 ; loop: printf(" \n Enter the calculation\n");// 定义标识 scanf(" %lf %c %lf",&number1,&op,&number2); fflush(stdin); //关键点:清除键盘缓存, switch(op){ case '+' : printf("= %lf \n",number1 + number2); break ; c…

2011-10-15 19:15 · 技术成长之路 · 评论(0)

学习笔记习题3.3

#include<stdio.h> #define price 5 int main(){ // const int price = 5 ; int shuliang = 0 ; printf(" 请输入一个数值!"); scanf("%d" ,&shuliang); if(shuliang >= 20 ){ printf("%.2f",(float)shuliang * 0.9 * price ); }else if(shuliang >= 50 ){ printf("%.2f",(float)shuliang * 0.7 * price ); }else{ printf("%d", sh…

2011-10-14 00:34 · 技术成长之路 · 评论(0)

学习笔记习题3.2

#include<stdio.h> int main340(){ int month = 0 ; int day = 0 ; int year = 0 ; char *m[] ={" " ,"January", "February", "Marth", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; printf("请输入月、日、年 \n"); scanf("%d %d %d" , &month,&day,&year); if( month > 12 || m…

2011-10-14 00:19 · 技术成长之路 · 评论(0)

第三章 例子

#include<stdio.h> int main(){ double number1 = 0.0 ; double number2 = 0.0 ; char op = 0 ; printf(" \n Enter the calculation\n"); scanf(" %lf , %c, %lf",&number1,&op,&number2); switch(op){ case '+' : printf("= %lf \n",number1 + number2); break ; case '-' : printf("= %lf \n",number1 - number2); break…

2011-10-13 21:51 · 技术成长之路 · 评论(0)

学习笔记习题2.3

/* programe exercise 2.3 */ #include<stdio.h> int main(){ float price_a = 3.5f ; float price_l = 5.5f ; int shuliang = 0 ; char Hhuaban = 'H' ; char putongban = 'P' ; char version ='0'; float je = 0.00f ; printf(" enter the version H or P: \n"); scanf("%c",&version) ; printf(" enter the shuliang yo…

2011-10-11 21:10 · 技术成长之路 · 评论(0)

C语言入门经典

/* programe which rember user to input width and length in inches,then output the square of the room in square yard */ #include<stdio.h> #include<math.h> int main(){ long length = 0L ; long width = 0L ; long sqreinches = 0L ; float sqre = 0.0f; printf(" Please input the room's width:"); scanf("%ld"…

2011-10-10 23:17 · 技术成长之路 · 评论(0)

学习笔记

/*write a programe,rember user to input a distanc in inches,the output the distance in yard foot,inches*/ /*one yard = 3 foot , one foot = 12 inches*/ #include<stdio.h> int main(){ long inches = 0L ; long foot = 0L ; long yard = 0L ; printf(" Input the Inches : "); scanf("%ld",&inches); foot = inch…

2011-10-10 22:49 · 技术成长之路 · 评论(0)

feodra 14 播放mp3

1、yum install banshee; 2、rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm yum install gstreamer-plugins-bad gstreamer-ffmpeg gstreamer-plugins-ugly -y

2011-06-26 15:54 · 学习新得 · 评论(0)

rhel6.1 server 安装amule

在rhel6.1下安装amule2.2.6 1、安装wxWidgets-2.9.0 2、源码编译安装amule 3、设置/etc/profile 加入:export LD_LIBRARY_PATH=/usr/local/lib

2011-06-17 19:51 · 技术成长之路 · 评论(0)

rhel6.1 server 安装transmission

不知道什么原因,在rhel server6.1上安装transmission总是有这样那样的错误,没办法不停降低transmission的版,在安装transmission1.8时顺利安装成功,没有高版本的各种部题,不知道什么原因。 下载transmission1.8的tar.bz的源码 解压,进入transimission目录, 1、./configure 2、make 3、make install

2011-06-16 22:16 · 技术成长之路 · 评论(0)

rhel6.1 配置本地更新源

1、在/etc/yum.repos.d/里建一个以.repo结尾的文件,写入相应的yum信息。 vi /etc/yum.repos.d/local.repo 2、写入信息 [local] name = yum baseurl=file:///back/rhel enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release 3、将镜像解压后根目录下的 RPM-GPG-KEY-redhat-release替换/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

2011-06-14 18:37 · 学习新得 · 评论(0)