Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- system("clear");
- cout<<"\n混成(VSEPR)計算器\n版本 1.1.5\n發布日期 110(2021)年03月23日\n由 BRiXPERT團隊 隨便亂製作\n\n註:\n使用時請將氫原子(H)視為7A族元素,否則會出現計算錯誤;\n由於中心原子只有在4A~7A間才會滿足八隅體,所以只要中心原子為1A~3A時,π鍵為0。\n\n";
- for(;;)
- {
- int in_A;
- int in_B;
- int a;
- int b;
- int e;
- float lp,pi;
- int sigma;
- cout<<"A原子族數(限A族): ";
- cin>>in_A;
- cout<<"A原子數量: ";
- cin>>a;
- cout<<"B原子族數(限A族): ";
- cin>>in_B;
- cout<<"B原子數量: ";
- cin>>b;
- cout<<"電子數: ";
- cin>>e;
- // ----
- float tmpA, tmpB, n;
- if(a >= b)
- sigma = a;
- else
- sigma = b;
- if(sigma <= 1)
- sigma = 2;
- if(a == 1)
- {
- tmpA = in_A;
- tmpB = in_B;
- n = b;
- }
- else
- {
- tmpA = in_B;
- tmpB = in_A;
- n = a;
- }
- lp = ((tmpA+e)-((8-tmpB) * n))/2;
- if(tmpA >= 4)
- pi = 4-sigma-lp;
- else
- pi = 0;
- cout<<"\n結果: ("<<sigma<<","<<lp<<")"<<pi<<"\n\n";
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment