c语言程序设计题汇总(C语言程序设计精髓习题总汇)

c语言程序设计题汇总(C语言程序设计精髓习题总汇)(1)

第一章 认识变量和常量1.1 hello world!

题目内容:使用printf()屏幕上输出hello world!

#include <stdio.h> int main() { printf(“hello world!\n”); return 0; } 123456

1.2 在屏幕上输出多行信息

题目内容:使用printf()函数在屏幕上输出多行信息:hello world!hello hit!Hello everyone!

#include <stdio.h> int main() { printf(“hello world!\n”); printf(“hello hit!\n”); printf(“hello everyone!\n”); return 0; } 123456789

1.3 计算半圆弧长以及半圆的面积

题目内容:编程并输出半径r=5.3的半圆弧长(提示:半圆弧长不应该加直径的长度。)及该半圆弧与直径围成的半圆的面积,π的取值3.14159。要求半径r和π必须利用宏常量表示。

#include<stdio.h> #define PI 3.14159 int main() { double r = 5.3,Area,circumference; printf(“Area = %.5f\n”,PI*r*r/2); printf(“circumference = %.5f\n”,PI*(r r)/2); } 123456789

1.4 计算长方形体积

题目内容:编程并输出长1.2、宽4.3、高6.4的长方形的体积。要求长方形的长、宽、高必须利用const常量表示。程序中用到的数类型均为double类型。

#include<stdio.h> int main() { double const l = 1.2,w = 4.3,h = 6.4; double v ; v = l*w*h; printf(“volume = %.3f\n”,v); } 12345678

第二章 计算2.1 输出逆序数

题目内容:从键盘任意输入一个3位整数,编程计算并输出它的逆序数(忽略整数前的正负号)。例如,输入-123,则忽略负号,由123分离出其百位1、十位2、个位3,然后计算3100 210 1 = 321,并输出321。第一种写法

#include<stdio.h> #include<math.h> int main() { int a,b,c,e,sum; printf("Input e:"); scanf("%d",&e); a=fabs(e/100); b=fabs((e/10)); c=fabs(e); sum=c*100 b*10 a; printf("a=%d,b=%d,c=%d,sum=%d\n",a,b,c,sum); return 0; } 1234567891011121314

第二种写法

#include <stdio.h> int main() { printf("Input x:\n"); int x,a,b,c; scanf("%d",&x); while (x < 0) { x = x * -1 ; } a = x % 10 ; b=x0/10; c=x/100; printf("y=%d\n",a*100 b*10 c); return 0; } 1234567891011121314151617

c语言程序设计题汇总(C语言程序设计精髓习题总汇)(2)

2.2 计算总分和平均数

题目内容:小明本学期共有5门课程,分别是英语、语文、数学、历史和音乐。5科的期中考试成绩分别是86分、74分、92分、77分、82分,期末考试成绩分别是81分、87分、90分、62分、88分。已知期中和期末考试成绩分别占总成绩的30%和70%。定义相应的变量存放各科成绩,并计算出小明5门课程的总分和平均分。要求平均分输出两种形式:带2位小数的浮点数形式和不带小数的整数形式。要求总分输出带2位小数的浮点数形式。程序中浮点数的数据类型均为float类型。

#include<stdio.h> int main() { int a[5]={86,74,92,77,82}; int b[5]={81,87,90,62,88}; float result=0,result1=0,result2=0; for(int i=0;i<5;i ) { result1 =a[i]; result2 =b[i]; } result=result1*0.3 result2*0.7; printf("total=%.2f\n",result); printf("average=%.2f\n",result/5.0); printf("average=%d\n",(int)result/5); return 0; } 1234567891011121314151617

2.3 存款利率计算器V1.0

题目内容:设银行定期存款的年利率rate为2.25%,已知存款期为n年,存款本金为capital元,试编程计算并输出n年后的本利之和deposit。程序中所有浮点数的数据类型均为double类型。

#include<stdio.h> #include <math.h> int main() { double capital,deposit,rate; int year; printf( "Please enter rate, year, capital:\n"); scanf("%lf,%d,%lf", &rate, &year, &capital); deposit=capital*pow(1 rate,year); printf("deposit=%.3f\n",deposit); return 0; } 12345678910111213

2.4 数位拆分v1.0

题目内容:现有一个4位数的正整数n=4321(即n是一个已知的数,固定为4321),编写程序将其拆分为两个2位数的正整数43和21,计算并输出拆分后的两个数的加、减、乘、除和求余的结果。例如n=4321,设拆分后的两个整数为a,b,则a=43,b=21。除法运算结果要求精确到小数点后2位,数据类型为float。

#include<stdio.h> #include <math.h> int main() { int x=4321,a,b; a=x/100; b=x0; printf("a=%d,b=%d\n",a,b); printf("a b=%d\n",a b); printf("a-b=%d\n",a-b); printf("a*b=%d\n",a*b); printf("a/b=%.2f\n",(float)a/b); printf("a%%b=%d\n",a%b); return 0; } 12345678910111213141516

2.5 求正/负余数

题目内容:在C语言中,如果被除数为负值,则对一个正数求余的时候,求出的余数也是一个负数。在某些场合下,我们需要求出它的正余数,例如:在C语言中有(-11)%5=-1,但是有时我们希望得到的余数不是-1,而是4。请编写程序计算(-11)%5的负余数和正余数。

#include<stdio.h> int main() { printf("negative: %d\n",-11%5); printf("positive: %d\n",-11%5 5); return 0; } 12345678

2.6 身高预测

题目内容:已知小明(男孩)爸爸的身高是175厘米,妈妈的身高是162厘米。小红(女孩)爸爸的身高是169厘米,妈妈的身高是153厘米,按照下面公式,预测并输出小明和小红的遗传身高(不考虑后天因素)。

#include<stdio.h> int main() { int mf=175,mm=162,hf=169,hm=153; printf("Height of xiao ming:%d\n",(int)((mf mm)*0.54)); printf("Height of xiao hong:%d\n",(int)((hf*0.923 hm)/2)); return 0; } 123456789

2.7 求一元二次方程的根

#include<stdio.h> #include<math.h> int main() { int a=2,b=3,c=1; double x1,x2; x1=-b/2.0/a; x2=sqrt(b*b-4*a*c)/2.0/a; printf("x1=%.4f\n",x1 x2); printf("x2=%.4f\n",x1-x2); return 0; } 12345678910111213

第三章 输入输出3.1 日期显示

题目内容:编写一个程序, 接收用户录入的日期信息并且将其显示出来. 其中, 输入日期的形式为月/日/年(mm/dd/yy), 输出日期的形式为年月日(yy.mm.dd)。以下为程序的运行结果示例:Enter a date (mm/dd/yy):12/03/2015↙You entered the date: 2015.12.03

#include<stdio.h> int main() { int mm,dd,yy; printf("Enter a date (mm/dd/yy):\n"); scanf("%d/%d/%d",&mm,&dd,&yy); printf("You entered the date: d.d.d\n",yy,mm,dd); return 0; } 123456789

3.2 产品信息格式化

题目内容:编写一个程序, 对用户录入的产品信息进行格式化。以下为程序的运行结果示例:Enter item number:385↙Enter unit price:12.5↙Enter purchase date (mm/dd/yy):12/03/2015↙Item Unit Purchase385 $ 12.50 12032015

#include<stdio.h> int main() { int number,mm,dd,yy; float price; printf("Enter item number:\n"); scanf("%d",&number); printf("Enter unit price:\n"); scanf("%f",&price); printf("Enter purchase date (mm/dd/yy):\n"); scanf("%d/%d/%d",&mm,&dd,&yy); printf("Item Unit Purchase\n"); printf("%-9d$ %-9.2fddd\n",number,price,mm,dd,yy); return 0; } 123456789101112131415

3.3 计算两个数的平方和

题目内容:从键盘读入两个实数,编程计算并输出它们的平方和,要求使用数学函数pow(x,y)计算平方值,输出结果保留2位小数。 程序中所有浮点数的数据类型均为float。

#include<stdio.h> #include<math.h> int main() { float x,y; printf("Please input x and y:\n"); scanf("%f,%f",&x,&y); printf("Result=%.2f\n",pow(x,2.0) pow(y,2.0)); return 0; } 12345678910

3.4 逆序数的拆分计算

题目内容:从键盘输入一个4位数的整数,编程计算并输出它的逆序数(忽略整数前的正负号)。例如,输入-1234,忽略负号,由1234分离出其千位1、百位2、十位3、个位4,然后计算41000 3100 2*10 1 = 4321,并输出4321。再将得到的逆序数4321拆分为两个2位数的正整数43和21,计算并输出拆分后的两个数的平方和的结果。

#include<stdio.h> #include<math.h> int main() { int x,y,x1,x2,x3,x4,a,b; printf("Input x:\n"); scanf("%d",&x); y=abs(x); x1=y/1000; x2=y/100; x3=y/10; x4=y; y=x1 10*x2 100*x3 1000*x4; a=x4*10 x3; b=x2*10 x1; printf("y=%d\n",y); printf("a=%d,b=%d\n",a,b); printf("result=%d\n",(int)pow(a,2) (int)pow(b,2)); return 0; } 1234567891011121314151617181920

3.5 拆分英文名

题目内容:从键盘输入某同学的英文名(小写输入,假设学生的英文名只包含3个字母。如: tom),编写程序在屏幕上输出该同学的英文名,且首字母大写(如: Tom)。同时输出组成该英文名的所有英文字符在26个英文字母中的序号。

#include<stdio.h> int main() { char a,b,c; printf("Input your English name:\n"); scanf("%c%c%c",&a,&b,&c); printf("%c%c%c\n",a-32,b,c); printf("%c:%d\n",a,a-'a' 1); printf("%c:%d\n",b,b-'a' 1); printf("%c:%d\n",c,c-'a' 1); return 0; } 123456789101112

3.6 计算体指数

题目内容:从键盘输入某人的身高(以厘米为单位,如174cm)和体重(以公斤为单位,如70公斤),将身高(以米为单位,如1.74m)和体重(以斤为单位,如140斤)输出在屏幕上,并按照以下公式计算并输出体指数,要求结果保留到小数点后2位。程序中所有浮点数的数据类型均为float。假设体重为w公斤,身高为h米,则体指数的计算公式为:t=w/h^2

#include<stdio.h> int main() { int weight,height; float h,t; printf("Input weight, height:\n"); scanf("%d,%d",&weight,&height); printf("weight = %d\n",weight*2); h=height/100.0; printf("height = %.2f\n",h); printf("t=%.2f\n",weight/h/h); return 0; } 12345678910111213

3.7 学分绩计算

题目内容:已知某大学期末考试学分绩的计算公式为:学分绩 =(工科数学 * 5 英语 * 1.5 线性代数 * 3.5) / 10请编程从键盘按顺序输入某学生的工科数学、英语和线性代数成绩,计算并输出其学分绩。

#include<stdio.h> int main() { int a,b,c; printf("Input math1, English and math2:"); scanf( "%d,%d,%d",&a,&b,&c); printf("Final score = %.2f\n",(a*5 b*1.5 c*3.5)/10); return 0; } 123456789

3.8 一尺之间,日取其半

题目内容:我国古代著作《庄子》中记载道:“一尺之捶,日取其半,万世不竭”。其含义是:对于一尺的东西,今天取其一半,明天取其一半的一半,后天再取其一半的一半的一半总有一半留下,所以永远也取不尽。请编写一个程序,使其可以计算出一条长为m的绳子,在n天之后剩下的长度。

#include<stdio.h> int main() { int b; float a; printf("Input length and days:"); scanf("%f,%d",&a,&b); for(b>0;b--;) { a/=2; } printf("length=%.5f\n",a); return 0; } 1234567891011121314

3.9 网购打折商品V1.0

题目内容:某网上购物网站对用户实行优惠,买家购物货款p越多,则折扣越多。今天正值该网站优惠折扣日,买家可以获得8%的折扣。请编程从键盘输入买家购物货款p,计算并输出买家折扣后实际应付出的价钱。注:程序中的数据类型为float。

#include<stdio.h> int main() { float price; printf("Input payment p:"); scanf("%f",&price); printf("price = %.1f\n",price*(1-0.08)); return 0; } 123456789

3.10 计算时间差V1.0

题目内容:编程从键盘任意输入两个时间(例如4时55分和1时25分),计算并输出这两个时间之间的间隔。要求不输出时间差的负号。

#include<stdio.h> #include<math.h> int main() { typedef struct clock { int hour; int minute; int second; } CLOCK; struct clock stu1; struct clock stu2; struct clock stu3; printf("Input time one(hour, minute):"); scanf("%d,%d", &stu1.hour,&stu1.minute); printf( "Input time two(hour, minute):"); scanf("%d,%d", &stu2.hour, &stu2.minute); stu3.hour = fabs((stu1.hour * 60 stu1.minute) - (stu2.hour * 60 stu2.minute)) / 60; stu3.minute = fabs(((stu1.hour * 60 stu1.minute) - (stu2.hour * 60 stu2.minute)) % 60); printf("%d hour %d minute\n", stu3.hour, stu3.minute); } 12345678910111213141516171819202122232425

第四章 选择4.1 检测用户错误输入

题目内容:根据scanf()的返回值判断scanf()是否成功读入了指定的数据项数,使程序在用户输入123a时,能输出如下运行果:123a↙Input error!

#include<stdio.h> #include<stdlib.h> int main() { int c; int a,b; c = scanf("%d %d",&a,&b); if(c==2) printf("a = %d,b = %d\n",a,b); else printf("input error!"); return 0; } 12345678910111213

4.2 闰年判断

题目内容:从键盘任意输入一个公元年份(大于等于1),判断它是否是闰年。若是闰年输出“Yes”,否则输出“No”。要求对输入数据进行合法性判断。已知符合下列条件之一者是闰年:(1)能被4整除,但不能被100整除;(2)能被400整除。

#include <stdio.h> #include <stdlib.h> int main() { int a; scanf("%d",&a); if(a>=1) { if(a%4==0&&a0!=0||a@0==0) printf("Yes\n"); else printf("No\n"); } else printf("Input error!\n"); return 0; } 1234567891011121314151617

4.3 程序改错

题目内容:下面代码的功能是将百分制成绩转换为5分制成绩,具体功能是:如果用户输入的是非法字符或者不在合理区间内的数据(例如输入的是a,或者102,或-45等),则程序输出 Input error!,否则将其转换为5分制输出。目前程序存在错误,请将其修改正确。并按照下面给出的运行示例检查程序。

//错误代码 #include<stdio.h> int main() { int score; char grade; printf("Please input score:"); scanf("%d", &score); if (score < 0 || score > 100) printf("Input error!\n"); else if (score >= 90) grade = 'A’; else if (score >= 80) grade = 'B'; else if (score >= 70) grade = 'C'; else if (score >= 60) grade = 'D'; else grade = 'E'; printf("grade:%c\n", grade); return 0; } 1234567891011121314151617181920212223

//更改后代码 #include<stdio.h> int main() { int score,x; char grade; printf("Please input score:\n"); x=scanf("%d", &score); if (score < 0 || score > 100 || x!=1) { printf("Input error!\n"); return 0; } else if (score >= 90) grade = 'A'; else if (score >= 80) grade = 'B'; else if (score >= 70) grade = 'C'; else if (score >= 60) grade = 'D'; else grade = 'E'; printf("grade: %c\n", grade); return 0; } 1234567891011121314151617181920212223242526

4.4 字符类型判断

题目内容:从键盘键入任意一个字符,判断该字符是英文字母(不区分大、小写)、数字字符还是其它字符。若键入字母,则屏幕显示 It is an English character.;若键入数字则屏幕显示It is a digit character.

#include<stdio.h> int main() { char ch; printf("Input simple:\n"); scanf("%c",&ch); if(ch<='z'&&ch>='a'||ch<='Z'&&ch>='A') printf("It is an English character.\n"); else if(ch<='9'&&ch>='0') printf("It is a digit character.\n"); else printf("It is other character.\n"); return 0; } 1234567891011121314

4.5 快递费用计算

快递费按邮件重量计算,由起重费用、续重费用两部分构成:(1) 起重(首重)1公斤按起重资费计算(不足1公斤,按1公斤计算),超过首重的重量,按公斤(不足1公斤,按1公斤计算)收取续重费;(2)同城起重资费10元,续重3元/公斤;(3)寄往1区(江浙两省)的邮件,起重资费10元,续重4元;(4)寄往其他地区的邮件,起重资费统一为15元。而续重部分,不同区域价格不同:2区的续重5元/公斤,3区的续重6.5元/公斤,4区的续重10元/公斤。编写程序,从键盘输入邮件的目的区域编码和重量,计算并输出运费,计算结果保留2位小数。程序中所有浮点数的数据类型均为float。提示:续重部分不足一公斤,按1公斤计算。因此,如包裹重量2.3公斤:1公斤算起重,剩余的1.3公斤算续重,不足1公斤按1公斤计算,1.3公斤折合续重为2公斤。如果重量应大于0、区域编号不能超出0-4的范围。

#include <stdio.h> #include <stdlib.h> int main() { int mark; float weight,price; scanf("%d,%f",&mark,&weight); if(mark<0||weight<=0||mark>4) printf("Error in Area\n"); else { if(weight<=1) weight=1; else weight=(int)weight 1; } switch(mark) { case 0 : price=10 (int)(weight-1)*3; break; case 1 : price=10 (int)(weight-1)*4; break; case 2 : price=15 (int)(weight-1)*5; break; case 3 : price=15 (int)(weight-1)*6.5; break; case 4 : price=15 (int)(weight-1)*10; break; } printf("Price: %5.2f\n",price); return 0; } 1234567891011121314151617181920212223242526272829303132

4.6 数位拆分v2.0

题目内容:从键盘上输入一个4位数的整数n,编写程序将其拆分为两个2位数的整数a和b,计算并输出拆分后的两个数的加、减、乘、除和求余运算的结果。例如n=-4321,设拆分后的两个整数为a,b,则a=-43,b=-21。除法运算结果要求精确到小数点后2位,数据类型为float。求余和除法运算需要考虑除数为0的情况,即如果拆分后b=0,则输出提示信息"The second operater is zero!"

#include<stdio.h> int main() { int n,a,b; printf("Please input n:\n"); scanf("%d",&n); a=n/100; b=n0; printf("%d,%d\n",a,b); printf("sum=%d,sub=%d,multi=%d\n",a b,a-b,a*b); if(b==0) printf("The second operator is zero!\n"); else printf("dev=%.2f,mod=%d\n",a/1.0/b,a%b); return 0; } 1234567891011121314

4.7 出租车计价

题目内容:已知某城市普通出租车收费标准为:起步里程为3公里,起步费为8元,10公里以内超过起步里程的部分,每公里加收2元,超过10公里以上的部分加收50%的回空补贴费,即每公里3元。出租车营运过程中,因堵车和乘客要求临时停车等客的,按每5分钟加收2元计算,不足5分钟的不计费。从键盘任意输入行驶里程(精确到0.1公里)和等待时间(精确到分钟),请编程计算并输出乘客应支付的车费,对结果进行四舍五入,精确到元。

#include<stdio.h> int main() { float dis,fee=0; int tim; printf("Input distance and time:"); scanf("%f,%d",&dis,&tim); tim=tim/5; fee =2*tim; if(dis>10){ fee =3*(dis-10); } if(dis>3){ dis=dis>=10?10:dis; fee =2*(dis-3); } if(dis>0){ fee =8; } printf("fee = %.0f\n",fee); return 0; } 12345678910111213141516171819202122

4.8 数据区间判断

题目内容:从键盘输入一个int型的正整数n(已知:0<n<10000),编写程序判断n落在哪个区间。如果用户输入的数据不在指定的范围里,程序输出 “error!”。例如,输入265,则该数属于区间 100-999。

#include<stdio.h> int main() { int x; printf("Please enter the number:\n"); scanf("%d",&x); if(x<=0||x>=10000) printf("error!\n"); else if(x>=0&&x<10) printf("%d: 0-9\n",x); else if(x>=10&&x<100) printf("%d: 10-99\n",x); else if(x>=100&&x<1000) printf("%d: 100-999\n",x); else if(x>=1000&&x<10000) printf("%d: 1000-9999\n",x); return 0; } 12345678910111213

4.9 计算一元二次方程的根v2.0

题目内容:根据下面给出的求根公式,计算并输出一元二次方程的两个实根,要求精确到小数点后4位。其中a,b,c的值由用户从键盘输入。如果用户输入的系数不满足求实根的要求,输出错误提示 “error!”。程序中所有的数据类型均为float。

#include<stdio.h> #include<math.h> int main() { float a,b,c,x,y; printf("Please enter the coefficients a,b,c:\n"); scanf("%f,%f,%f",&a,&b,&c); x=-b/2/a; y=b*b-4*a*c; if(y<0) printf("error!\n"); else printf("x1=%7.4f, x2=%7.4f\n",x sqrt(y)/2/a,x-sqrt(y)/2/a); return 0; } 123456789101112131415

4.10 分数比较

题目内容:利用人工方式比较分数大小的最常见的方法是:对分数进行通分后比较分子的大小。请编程模拟手工比较两个分数的大小。首先输入两个分数分子分母的值,例如"11/13,17/19",比较分数大小后输出相应的提示信息。例如,第一个分数11/13小于第二个分数17/19,则输出"11/13<17/19"。

#include<stdio.h> int main() { int a,b,c,d; int fenshu,fenshu2; printf("Input a/b, c/d:"); scanf("%d/%d,%d/%d",&a,&b,&c,&d); fenshu=a*d; fenshu2=c*b; if(fenshu>fenshu2) printf("%d/%d>%d/%d\n",a,b,c,d); else if(fenshu2>fenshu) printf("%d/%d<%d/%d\n",a,b,c,d); else printf("%d/%d=%d/%d\n",a,b,c,d); return 0; } 1234567891011121314151617

4.11 存款利率计算器v2.0

题目内容:设capital是最初的存款总额(即本金),rate是整存整取的存款年利率,n 是储蓄的年份,deposit是第n年年底账号里的存款总额。已知如下两种本利之和的计算方式:按复利方式计息的本利之和计算公式为:deposit = capital * (1 rate)^n按普通计息方式计算本利之和的公式为:deposit = capital * (1 rate * n)编程从键盘输入存钱的本金、存款期限以及年利率,然后再输入按何种方式计息,最后再计算并输出到期时能从银行得到的本利之和,要求结果保留到小数点后4位。

#include<stdio.h> #include<math.h> int main() { double capital , deposit , rate ; int n; char a; printf("Input rate, year, capital:"); scanf("%lf,%d,%lf",&rate,&n,&capital); printf("Compound interest (Y/N)?"); scanf("%c",&a); if (a=='y'||a=='Y') { deposit=capital*pow(1 rate,n); printf("deposit = %.4f\n",deposit); } else if(a=='n'||a=='N') { deposit=capital*(1 rate*n); printf("deposit = %.4f\n",deposit); } else printf("error"); return 0; } 12345678910111213141516171819202122232425

4.12 博弈论之Best Response

在博弈论中,有一种决策称为Best Response,通俗的意思就是选择一种策略使得团体利益最大化。C语言学习成绩的评定方式分为两种,一种是自由刷题模式(compete),没有固定标准,刷题越多者排名越靠前,其期末分数越高;另一种是规定每个人必须做够多少道题(standard),达到要求就能取得相应分数。假设一个班级中的学生分为A、B两类,A类同学学习热情很高,乐于做题,采用compete模式可以获得成就感并且在期末拿到高分,compete模式可以让他们有10分的收益;采用standard模式他们也可以在期末拿到高分,但不能满足他们的求知欲,standard模式可以让他们有8分的收益。B类同学仅仅希望期末拿高分,如果采用compete模式,他们竞争不过A类同学,期末成绩不理想,因此compete模式能给他们6分的收益;如果采用standard模式,他们可以完成规定任务并拿到高分,因此standard模式可以让他们有10分的收益。编程输入A类和B类同学分别占班级总人数的百分比,分别计算并输出采用compete和standard两种刷题模式下的全班总收益,并输出这个班级在这场博弈中的Best Response是哪种模式。注: 程序中使用的数据类型为float程序运行结果示例1:Input percent of A and B:0.2 0.8↙compete = 6.8000standard = 9.6000The Best Response is standard!程序运行结果示例2:Input percent of A and B:0.8 0.2↙compete = 9.2000standard = 8.4000The Best Response is compete!程序运行结果示例3:Input percent of A and B:0.5 0.5↙compete = 8.0000standard = 9.0000The Best Response is standard!输入提示信息:“Input percent of A and B:”输入格式: “%f%f”输出格式:“compete = %.4f\nstandard = %.4f\n”输出提示信息:“The Best Response is compete!”输出提示信息:“The Best Response is standard!”

#include<stdio.h> int main() { float a,b,compete,standard; printf("Input percent of A and B:"); scanf("%f%f",&a,&b); compete=a*10 b*6; standard=a*8 b*10; printf("compete = %.4f\nstandard = %.4f\n",compete,standard); if(compete>= standard) printf("The Best Response is compete!"); else printf("The Best Response is standard!"); return 0; } 123456789101112131415161718

关注我,私信回复“C语言”获取C语言/C 电子资料 详细视频讲解

需要 的话可以给我点个赞,转发下哦。

,

免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com

    分享
    投诉
    首页