自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 收藏
  • 关注

转载 谭浩强C语言第八章课后习题

1、输入三个整数,按照从小到大顺序输出 1 #include<stdio.h> 2 int main() 3 { 4 void swap(int *p1,int *p2); 5 int n1,n2,n3; 6 int *p1,*p2,*p3; 7 printf("input three integer n1,n2...

2019-10-04 20:04:00 1922

转载 c primer plus 编程练习答案第四章

最近在研读c primer plus,小白一枚,把自己做的答案写出来,望指正。 编程环境 visual studio 2010.第五章。 1 /* Programming Exercise 5-1 */ 2 #include<stdio.h> 3 #define N 60 4 int main(void) 5 {int a,b,c; 6 whi...

2019-09-29 18:38:00 123

转载 谭浩强C语言第七章课后习题

1、用函数法求最大公约数与最小公倍数 1 #include<stdio.h> 2 int main() 3 { 4 int hcf(int,int); 5 int lcd(int,int,int); 6 int u,v,h,l; 7 scanf("%d,%d",&u,&v); 8 h=...

2019-09-23 21:14:00 1480

转载 7-7/ 7-8课后例题

1、打擂台算法 1 #include<stdio.h> 2 int main() 3 { 4 int max(int x,int y); 5 int a[10],m,n,i; 6 printf("enter 10 numbers:"); 7 for(i=0;i<10;i++) 8 sca...

2019-08-16 21:06:00 400

转载 c语言谭浩强第七章例题

1、用递归求学生年龄 1 #include<stdio.h> 2 int main() 3 { 4 int age(int n); 5 printf("NO.5 age is %d\n",age(5)); 6 return 0; 7 } 8 int age(int n) 9 { 10 int c; 1...

2019-08-13 20:23:00 336

转载 谭浩强C语言第六章课后习题

1、用筛选法求100以内素数 1 #include<stdio.h> 2 #include<math.h> 3 int main() 4 { 5 int i,j,n,a[101]; 6 for(i=1;i<=100;i++) 7 a[i]=i; 8 a[1]=0; 9 f...

2019-08-09 21:08:00 562

转载 谭浩强C语言第六章例题

1、统计一共有多少单词 1 #include<stdio.h> 2 int main() 3 { 4 char string[100]; 5 int i,num=0,word=0; 6 char c; 7 gets(string); 8 for(i=0;(c=string[i])!='\0';i++)...

2019-08-04 19:51:00 176

转载 谭浩强版本C语言课后习题第五章

1 //输入两个正数mn,求最大公约数和最小公倍数 2 #include<stdio.h> 3 int main() 4 { 5 int p,r,m,n,temp; 6 printf("请输入两个正数:\n"); 7 scanf("%d,%d",&m,&n); 8 if(n<m) 9 ...

2019-08-01 20:05:00 438

转载 5.8循环程序举例

求pi的近似值 1 #include<math.h> 2 #include<stdio.h> 3 int main() 4 { 5 int sign=1; 6 double pi=0.0,n=1.0,term=1.0; 7 while(fabs(term)>=1e-6) 8 { 9 ...

2019-07-25 20:53:00 213

转载 谭浩强版本C语言课后习题第四章

2、对于逻辑量表达式1表示真,0表示假。 对于逻辑量表达式非0表示真,0表示假。 3、值得注意的是c语言中的优先级,优先级由高到低依次为: 4、 1 #include<stdio.h> 2 int main() 3 { 4 int a,b,c,t; 5 scanf("%d,%d,%d",&a,&b,&...

2019-07-22 19:21:00 174

转载 计算一元二次方程的解

1 #include<stdio.h> 2 #include<math.h> 3 int main() 4 { 5 double a,b,c,disc,x1,x2,realpart,imagpart; 6 scanf("%lf,%lf,%lf",&a,&b,&c); 7 printf("...

2019-07-20 21:23:00 277

转载 判断闰年

1、判断闰年 1 #include<stdio.h> 2 int main() 3 { 4 int year,leap; 5 printf("please enter year: "); 6 scanf("%d",&year); 7 if(year%4==0) 8 { 9 ...

2019-07-18 19:49:00 127

转载 谭浩强版本C语言课后习题第三章

例题3.2输入大写字母输出小写字母 1 #include<stdio.h> 2 int main() 3 { 4 char c1,c2; 5 c1=getchar(); 6 c2=c1+32; 7 putchar(c2); 8 putchar('\n'); 9 return 0; 10 ...

2019-07-16 15:13:00 217

转载 谭浩强版本C语言课后习题第二章

1.依次将十个数输入,要求输出其中最大的数。 1 #include <stdio.h> 2 int main() 3 { 4 int i,max,temp; 5 6 for(i=0; i<10; i++) 7 { 8 scanf("%d",&temp); 9 ...

2019-07-05 17:33:00 151

转载 c primer plus 编程练习答案第四章

最近在研读c primer plus,小白一枚,把自己做的答案写出来,望指正。 编程环境 visual studio 2010.第四章。 1 /* Programming Exercise 4-1 */ 2 #include<stdio.h> 3 int main(void) 4 { 5 char fname[40]; 6 cha...

2018-11-07 11:26:00 119

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除