寫一個hello world小程序:linux
shiyanlou:~/ $ cd Code/shiyanlou_cs122 shiyanlou:shiyanlou_cs122/ (master) $ mkdir lab1 shiyanlou:shiyanlou_cs122/ (master) $ cd lab1 shiyanlou:lab1/ (master*) $ vi hello.c
#include <stdio.h> int main() { printf("hello world!\n"); }
shiyanlou:lab1/ (master*) $ ls hello.c shiyanlou:lab1/ (master*) $ gcc -o hello hello.c shiyanlou:lab1/ (master*) $ ./hello hello world! shiyanlou:lab1/ (master*) $
shiyanlou:lab1/ (master*) $ git add hello.c shiyanlou:lab1/ (master*) $ git commit -m "hello world" [master 40425fe] hello world 1 file changed, 7 insertions(+) create mode 100644 lab1/hello.c shiyanlou:lab1/ (master*) $ git push ...... Counting objects: 4, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 339 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To git@git.shiyanlou.com:mengning/shiyanlou_cs122.git 5f24b93..40425fe master -> master shiyanlou:lab1/ (master*) $
完成實驗報告並公開發表(要求使用實驗樓的實驗報告),具體要求以下:git
請務必確認您提交的實驗報告中的實驗代碼能夠直接啓動實驗環境進行以下操做小程序
shiyanlou:~/ $ cd Code/code_refer shiyanlou:code_refer/ (master) $ ls README.md hello.c lab1 shiyanlou:code_refer/ (master) $ cd lab1 shiyanlou:lab1/ (master) $ gcc -o hello hello.c shiyanlou:lab1/ (master*) $ ./hello hello world! shiyanlou:lab1/ (master*) $ vi hello.c