2、%0.2fi",-b/(2*a),sqrt(-d)/(2*a));printf("x2=%0.2f-%0.2fi",-b/(2*a),sqrt(-d)/(2*a));输入输出示例:括号内为说明输入:5(repeat=5)000(a=0,b=0,c=0)001(a=0,b=0,c=1)024(a=0,b=2,c=4)2.18.93.5(a=2.1,b=8.9,c=3.5)123(a=1,b=2,c=3)输出:参数都为零,方程无意义!a和b为0,c不为0,方程不成立x=-2.00x1=-0.44x2=-3.80x1=-1.00+1.41ix2=-1.00-1.41
3、i#include#includeintmain(void){intrepeat,ri;doublea,b,c,d;scanf("%d",&repeat);for(ri=1;ri<=repeat;ri++){scanf("%lf%lf%lf",&a,&b,&c);/*---------*/}}#include#includeintmain(void){intrepeat,ri;doublea,b,c,d;scanf("%d",&repeat);for(ri=1;ri<=repeat;ri++){sca
4、nf("%lf%lf%lf",&a,&b,&c);/*---------*/d=b*b-4*a*c;if(a==0)if(b==0)if(c==0)printf("参数都为零,方程无意义!");elseprintf("a和b为0,c不为0,方程不成立");elseprintf("x=%0.2f",-c/b);elseif(d>=0){printf("x1=%0.2f",(-b+sqrt(d))/(2*a));printf("x2=%0.2f",(-b-sqrt(d))/(2*a));}else{printf("x1=%0.2f+%0.2fi",
5、-b/(2*a),sqrt(-d)/(2*a));printf("x2=%0.2f-%0.2fi",-b/(2*a),sqrt(-d)/(2*a));}}}程序填空,不要改变与输入输出有关的语句。输入10个字符,统计其中英文字母、空格或回车、数字字符和其他字符的个数。输入输出示例:括号内是说明输入Reold123?输出letter=5,blank=1,digit=3,other=1#includeintmain(void){charc;intblank,digit,i,letter,other;blank=digit=letter=other=0
6、;for(i=1;i<=10;i++){c=getchar();/*---------*/}printf("letter=%d,blank=%d,digit=%d,other=%d",letter,blank,digit,other);}#includeintmain(void){charc;intblank,digit,i,letter,other;blank=digit=letter=other=0;for(i=1;i<=10;i++){c=getchar();switch(c){case'':case'':blank++;break;c
7、ase'0':case'1':case'2':case'3':case'4':case'5':case'6':case'7':case'8':case'9':digit++;break;case'a':case'b':case'c':case'd':case'e':case'f':case'g':case'h':case'i':case'j':case'k':case'l':case'm':case'n':case'o':case'p':case'q':case'r':case's':case't':case'u':case'v':case'w':c