| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:化学里的东东(新手参考,大神勿进)In Reply To:化学里的东东(新手参考,大神勿进) Posted by:2004140022 at 2015-10-26 15:14:41 > 相信理科生并不陌生,高中化学里应该经常遇到。Ka是弱酸的电离平衡常数,无论你加什么酸,体积多少,平衡常数是不变的(好像是和温度有关,具体忘记了)。一摩尔酸会电离出 m 摩尔 H+ 和 n 摩尔酸离子(例如盐酸是Cl-,硫酸是SO4 2-),有c摩尔酸分子,电离了x摩尔,那么剩下c-x,根据方程:
> Ka=m*x(H+) * n*x(酸离子) / c-x 调整一下,有
> m*n*x*x+Ka*x-Ka*c=0;那么好了,求x,求根公式就可以了。
> x=(-Ka+sqrt(Ka*Ka+4*m*n*Ka*c))/(2*m*n);
> 最后得出x*m就是酸的摩尔数,-log10(x*m)得出pH值。
>
> #include<iostream>
> #include<stdio.h>
> #include<math.h>
> #include<stdlib.h>
> #include<string>
> #include<string.h>
> #include<algorithm>
> using namespace std;
> int main()
> {
> double k,x,m,n,ans;
> while(1)
> {
> scanf("%lf%lf%lf%lf",&k,&x,&m,&n);
> if(m+n+k+x==0)break;
> ans=(-k+sqrt(k*k+4*m*n*k*x))/(2*n);
> printf("%.3f\n",-log10(ans));
> }
> return 0;
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator