Problem J: 求方程的解——C语言初学者百题大战之十五
#include<stdio.h>
#include<math.h>
int main()
{
float a,b,c,x1,x2,delta;
scanf("%f %f %f",&a,&b,&c);
delta=b*b-*a*c;
if(a==){
if(b==)
printf("No\n");
else
printf("%f\n",(-c)/b);
}
if(a!=){
if(delta>){
x1=(-b+sqrt(delta))/(*a);
x2=(-b-sqrt(delta))/(*a);
printf("%f\n%f\n",x1,x2);
}
if(delta==){
x1=(-b+sqrt(delta))/*a;
printf("%f\n",x1);
}
if(delta<){
printf("No\n");
}
}
return ;
}
Problem J: 求方程的解——C语言初学者百题大战之十五的更多相关文章
- Problem M: 第几天——C语言初学者百题大战之十八
#include<stdio.h> int main() { int a,b,c,s; scanf("%d-%d-%d",&a,&b,&c); ...
- Problem O: 逆序输出——C语言初学者百题大战之二十
#include<stdio.h> int main() { int a,b,c,d,e,n; scanf("%d",&n); a=n/; b=n%/; c=n ...
- 鹦鹉学舌1——C语言初学者百题大战之三
#include<stdio.h> int main() { int a; scanf("%d",&a); printf("%d",a-a+ ...
- Very Good!——C语言初学者百题大战之二
#include<stdio.h> int main() { printf("***************\n\n Very Good!\n\n***************& ...
- a + b ——C语言初学者百题大战之四
#include <stdio.h> int main() { int a,b; scanf("%d %d",&a,&b); printf(" ...
- Problem J: 求个最大值
Problem J: 求个最大值 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 871 Solved: 663[Submit][Status][Web ...
- 【Java例题】4.4使用牛顿迭代法求方程的解
4. 使用牛顿迭代法求方程的解:x^3-2x-5=0区间为[2,3]这里的"^"表示乘方. package chapter4; public class demo4 { publi ...
- 「浙江理工大学ACM入队200题系列」问题 F: 零基础学C/C++39——求方程的解
本题是浙江理工大学ACM入队200题第四套中的F题 我们先来看一下这题的题面. 由于是比较靠前的题目,这里插一句.各位新ACMer朋友们,请一定要养成仔细耐心看题的习惯,尤其是要利用好输入和输出样例. ...
- Codeforces Gym 100342J Problem J. Triatrip 求三元环的数量 bitset
Problem J. Triatrip Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100342/at ...
随机推荐
- java程序在centos7里面开机自启动
1.我们先来个简单的start,status,stop程序: [root@localhost ~]# cat /home/tomcat/jarservice.sh #!/bin/bashCU_PID= ...
- 【bzoj3926- [Zjoi2015]诸神眷顾的幻想乡】广义sam
题意:给定一棵树,每个节点有一个颜色,问树上有多少种子串(定义子串为某两个点上的路径),保证叶子节点数<=20.n<=10^5 题解: 叶子节点小于等于20,考虑将每个叶子节点作为根把树给 ...
- poj1379 Run Away
传送门:http://poj.org/problem?id=1379 [题解] 题目大意:求(0,0)->(X,Y)内的一个点,使得这个点到给定的n个点的最小距离最大. 模拟退火 一开始可以先把 ...
- 汕头市队赛 SRM 06 A 撕书
A 撕书 SRM 06 背景&&描述 游行寺汀正在杀书. 书总共有n页,每页都可以看作是一个小写英文字母,所以我们可以把书看成长度为n的字符串s. 琉璃 ...
- Swift “ambiguous use of operator '>'”
http://stackoverflow.com/questions/25458548/swift-ambiguous-use-of-operator 3down votefavorite I h ...
- 热安装NGINX并支持多站点SSL
https://www.moonfly.net/801.html http://www.centoscn.com/image-text/config/2015/0423/5251.html 1.查看n ...
- LNMP的基本配置
LNMP的基本配置cd /usr/local/nginx_php/etc/ > php-fpm.conf //清空php-fpm.conf vim ph ...
- sqlalchemy源代码阅读随笔(1)
今天看的,是url.py模块,这个在create_engine中,起到的最用很大,其本质,就是对访问数据库的url,进行操作管里.我们可以直接访问这个类. 看一个简单的代码: from sqlalch ...
- EAScript 2016的新增语法(1)
1)let 语法,这个和var的声明类似,但是,只存在于其所在的代码块里. 举例: var x=1 console.log(x) { let x=2 console.log(x) } console. ...
- 根据流程实例ID获取当前任务
JAVA: Task task = this.processEngine.getTaskService().createTaskQuery().processInstanceId(“132501”). ...