-1
嘿c大師..我試圖將下面的shell腳本代碼轉換爲c。請協助我在c中重新編碼。在此先感謝..轉換shellcript代碼到c
#count1:
#! /bin/sh
# count1 appends an increment to a file 100 times
# note that a file called numbers must be initialised to contain 0
count=0
while [ $count -lt 100 ] # loop 100 times
do
count=`expr $count + 1` # increment counter
n=`tail -1 numbers` # get last line from numbers file
expr $n + 1 >> numbers # add 1 to it and append it back
done
你在問我們爲你寫代碼嗎?這不是「協助」,而是更多「做」,不是? – Borealid 2011-02-28 12:52:27