1、二、分支结构1、求一元二次方程的根(调试示例 error03_1)程序填空,不要改变与输入输出有关的语句。输入一个正整数 repeat (0#include int main(void)int repeat, ri;double a, b, c, d;scanf(“%d“, for(ri = 1; ri =0) printf(“x1 = %0.2fn“, (-b+sqrt(d)/(2*a);printf(“x2 = %0.2fn“, (-b-sqrt(d)/(2*a);else if (dint main(void)char ch;int blank, digit, i, letter, ot
2、her;blank = digit = letter = other = 0;for(i = 1; i =adouble price;for(i = 1; i int main(void)int i, mark, n;int na, nb, nc, nd, ne;scanf(“%d“,na = nb = nc = nd = ne = 0;for(i = 1; i =90) na+;else if(mark =80) nb+;else if(mark =70) nc+;else if(mark =60) nd+;else ne+;printf(“Number of A(90-100): %dn“
3、, na);printf(“Number of B(80-89): %dn“, nb);printf(“Number of C(70-79): %dn“, nc);printf(“Number of D(60-69): %dn“, nd);printf(“Number of E(0-59): %dn“, ne);5、对两个整数进行乘、除和求余运算(改错题 error03_2)程序填空,不要改变与输入输出有关的语句。输入一个正整数 repeat (0int main(void)char sign;int x, y;int repeat, ri;scanf(“%d“,for(ri = 1;ri i
4、nt main(void)int repeat, ri;int minutes, seconds;double cost, mile;scanf(“%d“, for(ri = 1; ri = repeat; ri+)scanf(“%lf%d%d“, mile += ( (minutes+ seconds/60.0)/5.0 );if (mile = 3.0) cost = 10.0 ;else if (mile = 10.0)cost = 10 + (mile-3.0) * 2.0 ; else cost = 10.0 + 7.0 * 2.0 + (mile-10.0)* 3.0;printf(“cost = %.0fn“, cost);