欢迎来到天天文库
浏览记录
ID:1504849
大小:25.35 KB
页数:9页
时间:2017-11-12
《实验03 分支结构程序设计》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、求一元二次方程的根(改错题error03_1)程序填空,不要改变与输入输出有关的语句。输入一个正整数repeat(02、义!a和b为0,c不为0,方程不成立x=-2.00x1=-1.00+2.00ix2=-1.00-2.00i#include#includeintmain(void){intri,repeat;doublea,b,c,d;scanf("%d",&repeat);for(ri=1;ri<=repeat;ri++){scanf("%lf%lf%lf",&a,&b,&c);d=b*b-4*a*c;/*---------*/return0;}求三角形的面积和周长(改错题error03_2),不要改变与输入输出有3、关的语句。输入一个正整数repeat(04、perimeter);printf("Thesesidesdonotcorrespondtoavalidtriangle");输入输出示例:括号内是说明输入2(repeat=2)553(a=5,b=5,c=3)141(a=1,b=4,c=1)输出area=7.15;perimeter=13.00Thesesidesdonotcorrespondtoavalidtriangle#include#includeintmain(void){inta,b,c;intrepeat,ri;doublearea5、,perimeter,s;scanf("%d",&repeat);for(ri=1;ri<=repeat;ri++){scanf("%d%d%d",&a,&b,&c);/*---------*/}return0;}求分段函数的值程序填空,不要改变与输入输出有关的语句。输入一个正整数repeat(00输入输出示例:括号内是说明输入3(repeat=3)10(x=10)0(x=0)-98(6、x=-98)输出sign(10)=1(x=10时y=1)sign(0)=0(x=0时y=0)sign(-98)=-1(x=-98时y=-1)#includeintmain(void){intrepeat,ri;intx,y;scanf("%d",&repeat);for(ri=1;ri<=repeat;ri++){scanf("%d",&x);/*---------*/printf("sign(%d)=%d",x,y);}return0;} 判断x能否被3、5、7整除程序填空,不要改变与输入输出有关的语句。输入一7、个正整数repeat(0intmain(void){intx;intri,repeat;scanf("%d",&repeat)8、;for(ri=1;ri<=repeat;ri++){scanf("%d",&x);/*---------*/return0;} 显示五级记分制成绩所对应的百分制成绩区间(使用switch)序填空,不要改变与输入输出有关
2、义!a和b为0,c不为0,方程不成立x=-2.00x1=-1.00+2.00ix2=-1.00-2.00i#include#includeintmain(void){intri,repeat;doublea,b,c,d;scanf("%d",&repeat);for(ri=1;ri<=repeat;ri++){scanf("%lf%lf%lf",&a,&b,&c);d=b*b-4*a*c;/*---------*/return0;}求三角形的面积和周长(改错题error03_2),不要改变与输入输出有
3、关的语句。输入一个正整数repeat(04、perimeter);printf("Thesesidesdonotcorrespondtoavalidtriangle");输入输出示例:括号内是说明输入2(repeat=2)553(a=5,b=5,c=3)141(a=1,b=4,c=1)输出area=7.15;perimeter=13.00Thesesidesdonotcorrespondtoavalidtriangle#include#includeintmain(void){inta,b,c;intrepeat,ri;doublearea5、,perimeter,s;scanf("%d",&repeat);for(ri=1;ri<=repeat;ri++){scanf("%d%d%d",&a,&b,&c);/*---------*/}return0;}求分段函数的值程序填空,不要改变与输入输出有关的语句。输入一个正整数repeat(00输入输出示例:括号内是说明输入3(repeat=3)10(x=10)0(x=0)-98(6、x=-98)输出sign(10)=1(x=10时y=1)sign(0)=0(x=0时y=0)sign(-98)=-1(x=-98时y=-1)#includeintmain(void){intrepeat,ri;intx,y;scanf("%d",&repeat);for(ri=1;ri<=repeat;ri++){scanf("%d",&x);/*---------*/printf("sign(%d)=%d",x,y);}return0;} 判断x能否被3、5、7整除程序填空,不要改变与输入输出有关的语句。输入一7、个正整数repeat(0intmain(void){intx;intri,repeat;scanf("%d",&repeat)8、;for(ri=1;ri<=repeat;ri++){scanf("%d",&x);/*---------*/return0;} 显示五级记分制成绩所对应的百分制成绩区间(使用switch)序填空,不要改变与输入输出有关
4、perimeter);printf("Thesesidesdonotcorrespondtoavalidtriangle");输入输出示例:括号内是说明输入2(repeat=2)553(a=5,b=5,c=3)141(a=1,b=4,c=1)输出area=7.15;perimeter=13.00Thesesidesdonotcorrespondtoavalidtriangle#include#includeintmain(void){inta,b,c;intrepeat,ri;doublearea
5、,perimeter,s;scanf("%d",&repeat);for(ri=1;ri<=repeat;ri++){scanf("%d%d%d",&a,&b,&c);/*---------*/}return0;}求分段函数的值程序填空,不要改变与输入输出有关的语句。输入一个正整数repeat(00输入输出示例:括号内是说明输入3(repeat=3)10(x=10)0(x=0)-98(
6、x=-98)输出sign(10)=1(x=10时y=1)sign(0)=0(x=0时y=0)sign(-98)=-1(x=-98时y=-1)#includeintmain(void){intrepeat,ri;intx,y;scanf("%d",&repeat);for(ri=1;ri<=repeat;ri++){scanf("%d",&x);/*---------*/printf("sign(%d)=%d",x,y);}return0;} 判断x能否被3、5、7整除程序填空,不要改变与输入输出有关的语句。输入一
7、个正整数repeat(0intmain(void){intx;intri,repeat;scanf("%d",&repeat)
8、;for(ri=1;ri<=repeat;ri++){scanf("%d",&x);/*---------*/return0;} 显示五级记分制成绩所对应的百分制成绩区间(使用switch)序填空,不要改变与输入输出有关
此文档下载收益归作者所有