71 lines
4.5 KiB
Markdown
71 lines
4.5 KiB
Markdown
|

|
||
|
|
||
|
[](https://www.youtube.com/c/PGTechs "ช่อง YouTube ของเรา")
|
||
|
[](https://www.facebook.com/PrincegameRVCPlus "เพจข่าวสาร Distributed Computing ของเรา บน Facebook")
|
||
|
|
||
|
อีกหนึ่งแอปพลิเคชันคุณภาพจาก SashaPGT
|
||
|
|
||
|
* ทุกแอปพลิเคชันผ่านการทดสอบติดตั้งและใช้งานใน Linux-based test machine ของเรา
|
||
|
|
||
|
* ใช้งานได้อย่างสะดวกรวดเร็ว ด้วยสคริปต์ติดตั้งแบบสำเร็จรูป ทั้งเฉพาะผู้ใช้และ System-wide
|
||
|
|
||
|
* รองรับ Linux ทุก Distribution
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
# sashapgt/avg-height-finder-alt
|
||
|
|
||
|
[](https://getfedora.org "Fedora Linux")
|
||
|
[](https://en.wikipedia.org/wiki/C%2B%2B "C++ Programming Language")
|
||
|
[](https://kdevelop.org "A cross-platform IDE for C, C++, Python, QML/JavaScript and PHP")
|
||
|
[](https://gcc.gnu.org "GNU Compiler Collection")
|
||
|
|
||
|
|
||
|
"จงเขียนโปรแกรมเพื่อรับข้อมูลความสูงของนักเรียน 10 คน แล้วแสดงผลลัพธ์ความสูงของนักเรียน 10 คน พร้อมหาว่าความสูงเฉลี่ยของนักเรียน 10 คนเป็นเท่าไร"
|
||
|
|
||
|
โปรแกรมจะรับค่าความสูงของทั้ง 10 คน แสดงผลตวามสูงของทั้ง 10 คน และแสดงค่าเฉลี่ยออกมา
|
||
|
|
||
|
**เป็นอีกเวอร์ชันหนึ่งของ avg-height-finder ในเวอร์ชันนี้ จะมีการใช้ array ในการเก็บและแสดงผลค่าตัวแปร**
|
||
|
|
||
|
**ตัวอย่างการทำงานของโปรแกรม**
|
||
|
|
||
|

|
||
|
|
||
|
**วิธีติดตั้ง (สำหรับ Linux เท่านั้น)**
|
||
|
|
||
|
1. โคลน git นี้
|
||
|
|
||
|
`$ git clone https://gitlab.com/sashapgt/avg-height-finder-alt.git`
|
||
|
|
||
|
2. cd เข้าโฟลเดอร์ของ git นี้ แล้วรันสคริปต์ติดตั้ง
|
||
|
|
||
|
`$ cd avg-height-finder-alt && bash install.sh`
|
||
|
|
||
|
3. เรียกใช้จากเทอร์มินัล (Shell autocomplete จะยังไม่ทำงานสำหรับคำสั่งใหม่นี้ หากต้องการ autocomplete กรุณาปิดเทอร์มินัล แล้วเปิดใหม่อีกครั้ง)
|
||
|
|
||
|
`$ avg-height-finder-alt`
|
||
|
|
||
|
|
||
|
|
||
|
**วิธีถอนการติดตั้ง (สำหรับ Linux เท่านั้น)**
|
||
|
|
||
|
1. รันสคริปต์ถอนการติดตั้งจากในโฟลเดอร์ git นี้
|
||
|
|
||
|
`$ bash uninstall.sh`
|
||
|
|
||
|
2. ลบโฟลเดอร์ git นี้
|
||
|
|
||
|
**การแก้ปัญหา**
|
||
|
|
||
|
หากไม่สามารถรันได้เนื่องจาก Command not found ให้ดูว่ามี ~/.local/bin ใน $PATH หรือไม่
|
||
|
สามารถตรวจสอบได้โดยการ
|
||
|
|
||
|
echo $PATH
|
||
|
|
||
|
หากไม่มี Home folder ของคุณ ตามด้วย .local/bin ให้เพิ่มบรรทัดนี้ลงใน Shell startup script ของคุณ (เช่น .bashrc .zshrc)
|
||
|
|
||
|
export PATH="$PATH:$HOME/.local/bin"
|
||
|
|
||
|
|