正在加载图片...
#indude"math h ain float X,y; printf \nPlease input the x: ) scanf( %f,&x) y=pow(x, 3)-1 else +1 if(X<=10) y=3*x+5; else y=5*x+3*og(2*x*X-1)-13 printf( \ ny=%fy) 4.编写程序,输入年号,判断并输出该年是否闰年。 mal int printf \nPlease input the year scanf(%d", &year) f(year%4==0&&year%100!=0| lyear%400==0) printf( \ n%d is a leap year "year) printf( n%d is not a leap year! year) 6.从键盘输入三个数,代表三条线段的长度。请编写程序,判断这三条线段组 成的三角形是什么类型(不等边、等腰、等边或不能构成三角形) ma int a, b, cr printf \nPlease input three numbers: ) scanf(%d%d%d"r &a, &b, &c) if(a+b>c&&b+c>a&&a+c>b) if(a==b&&b==c) printf \nThis is an equilateral triangle if(a==blb==clla==c)#include “math.h” main() { float x,y; printf(“\nPlease input the x:”); scanf(“%f”,&x); if(x<-1) y=pow(x,3)-1; else if(x<=1) y=-x*x+1; else if(x<=10) y=3*x+5; else y=5*x+3*log(2*x*x-1)-13; printf(“\ny=%f”,y); } 4. 编写程序,输入年号,判断并输出该年是否闰年。 main() { int year; printf(“\nPlease input the year:”); scanf(“%d”,&year); if(year%4==0&&year%100!=0||year%400==0) printf(“\n%d is a leap year!”,year); else printf(“\n%d is not a leap year!”,year); } 6. 从键盘输入三个数,代表三条线段的长度。请编写程序,判断这三条线段组 成的三角形是什么类型(不等边、等腰、等边或不能构成三角形)。 main() { int a,b,c; printf(“\nPlease input three numbers:”); scanf(“%d%d%d”,&a,&b,&c); if(a+b>c&&b+c>a&&a+c>b) { if(a==b&&b==c) printf(“\nThis is an equilateral triangle!”); else if(a==b||b==c||a==c)
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有