发布时间:2014-12-15 11:56:52
#include<stdio.h>int result_num(double a ,double b,double c){if((b*b-4*a*c)/2*a>0){return 2;}else if((b*b-4*a*c)/2*a==0){return 1;}else {return 0;}}int main(){double a,b,c;scanf("%f%f%f");printf("方程的根%d个实数根\n",result_num(a,b,c));}.........【阅读全文】
发布时间:2014-12-15 11:48:13
#include<stdio.h>double calculator(double a, double b, char operator){if (operator=='+'){return a+b;}else if (operator=='-'){return a-b;}else if (operator=='*'){return a*b;}else if (operator=='/'){if(b==0){printf(" 输入的有误,除数不能为零\n");}else{return a/b;}}else&.........【阅读全文】
发布时间:2014-11-26 23:06:02
1.#include <stdio.h>int main(){float shuxue, yuwen ,waiyu ,huaxue,zongfen;int select;shuxue=138;yuwen=56;waiyu=98;huaxue=100;zongfen=394; scanf("%d",&select);if (select==1) {printf("shuxue is %.2f\n",shuxue);return 0;}else if(select==2){printf("yuwen is .........【阅读全文】