<pre id="bbfd9"><del id="bbfd9"><dfn id="bbfd9"></dfn></del></pre>

          <ruby id="bbfd9"></ruby><p id="bbfd9"><mark id="bbfd9"></mark></p>

          <p id="bbfd9"></p>

          <p id="bbfd9"><cite id="bbfd9"></cite></p>

            <th id="bbfd9"><form id="bbfd9"><dl id="bbfd9"></dl></form></th>

            <p id="bbfd9"><cite id="bbfd9"></cite></p><p id="bbfd9"></p>
            <p id="bbfd9"><cite id="bbfd9"><progress id="bbfd9"></progress></cite></p>
            C語言

            計算機等考二級C語言學習要領

            時間:2025-03-14 22:15:02 C語言 我要投稿
            • 相關推薦

            計算機等考二級C語言學習要領

              不少同學都覺得計算機語言很枯燥,對它毫無興趣,下面百分網小編給大家分享計算機等考二級C語言學習要領,希望幫助到學習計算機感到迷茫的同學們。

            計算機等考二級C語言學習要領

              1、計算機語言挺枯燥的,如何提起興趣

              答:首先要明確學習的目標,沒有明確的學習目標就沒有學習動力。給自己定一個目標,比如這次一定通過計算機等級考試,或者這個月學習完做個東西出來等等。其次,確定了目標之后,要認真去做,多上機操作實踐,遇到不懂的要多跟教師和其他學員交流,千萬不能放棄。當自己編的一段小程序運行通過,或攻下一道難題,自己就會獲得一種成就感,可能還會很興奮,也就漸漸有了興趣。最后,要把所學的知識運用到實際問題當中,這樣既可以鞏固所學的知識,不至于完學了就忘,還可以根據實際需要拓展知識面。這樣良性循環,興趣也會越來越濃。

              2、有學員來信問到:我的電腦里安裝的TURBO?C(970K)不能正常的編譯,現象是:在編譯過程中,提示沒有錯誤也沒有警告,按任意鍵返回,可是在電腦上不能生成"OBJ"文件,有時提示:Unable to open input file’cos.obj’,我的朋友從他們學校的PC上拷貝回來的程序也出現這個問題?!在他們學校卻很正常,這是怎么回事?這個問題一直在困擾我,使我的學習不能進行下去!請幫我解決。謝謝!

              答:這需要重新設置options--directories中的include目錄和lib目錄,設為你C的安裝目錄就可以了。記住要保存喲!

              3、#include

              main()

              {int m=7,n=4;

              float a=38.4,b=6.4,x;

              x=m/2+n*a/b+1/2;

              printf("%f\n",x);

              }

              這個程序的結果是27.000000

              為什么我一直算的是28.000000呢?請指教

              答:main()

              {

              int m=7,n=4;

              float a=38.4,b=6.4,x;

              x=m/2+n*a/b+1/2;

              printf("%f\n",x);

              }

              m/2==3;因為m是整形所以結果為整形不是3.5而是3

              同樣1/2不是0.5而是0。

              要改的話,x=(float)m/2+n*a/b+1.0/2.0;

              結果為28.0000

              4、有些人說我的程序很難讓人看懂,請問如何將程序寫得規范、簡潔明了

              答:這是編程中重要的一點,要養成良好的編程習慣。請看一個例題:程序很簡單,是用TURBO C編一個時鐘程序。具體如下:

              /****************************************************

              Module:clock.c

              just a test of my programming ability

              *****************************************************/

              #include"math.h"

              #include"dos.h"

              #include"stdio.h"

              #include"graphics.h"

              main()

              {

              char s[30];

              int gdriver,gmode;

              int cosh,sinh,cosm,sinm,coss,sins;

              struct ;time t;

              char keydown=0;

              int x=300,y=160,r=40;

              clrscr();

              gdriver=9; gmode=1;

              initgraph(&gdriver,&gmode,"a:\\");/*需要說明的是,第三個參數a:\\是egavga.bgi這個文件的路徑*/

              /* install the graphic device.the third parameter is the path of the driver*/

              setbkcolor(0);

              setcolor(WHITE);

              while(1)

              {

              circle(x,y,r);/*paintthecircle*/

              line(x,y+r-10,x,y+r-12);

              line(x+r-4,y,x+r,y);

              line(x-r,y,x-r+4,y);

              line(x,y-r+10,x,y-r+10+2); /* draw the fout scales */

              gettime(&t);

              sprintf(s,"The current time is %2d:%02d:%02d\n",t.ti_hour,t.ti_min,t.ti_sec,t);

              outtextxy(0,0,s); /* out put the current time */

              outtextxy(0,10,"This clock is written by lijun"); /*?show the auther */

              coss=(int)((r-10)*cos(t.ti_sec*3.14f/30-3.14f/2)+x);

              sins=(int)((r-10)*sin(t.ti_sec*3.14f/30-3.14f/2)+y);

              cosm=(int)((r-19)*cos(t.ti_min*3.14f/30-3.14f/2)+x);

              sinm=(int)((r-19)*sin(t.ti_min*3.14f/30-3.14f/2)+y);

              cosh=(int)((r-28)*cos((t.ti_hour+(float)(t.ti_min)/60)*3.14f/6-3.14f/2)+x);

              sinh=(int)((r-28)*sin((t.ti_hour+(float)(t.ti_min)/60)*3.14f/6-3.14f/2)+y);

              /* calculate the position of the three points */

              setcolor(14);

              line(x,y,coss,sins);

              setcolor(13);

              line(x,y,cosm,sinm);

              setcolor(10);

              line(x,y,cosh,sinh);

              setcolor(15);

              /* draw the points */

              sleep(1);

              clrscr();&nb

              sp;

              keydown=kbhit();/* check whether key down */

              if(keydown)

              {

              closegraph();/* close graphic device */

              exit(0);

              }

              }

              }

            【計算機等考二級C語言學習要領】相關文章:

            2017計算機等考二級《C語言》常考問題05-18

            計算機二級C++C++語言概述05-08

            計算機二級c語言試題06-24

            2017年計算機二級C語言考點學習02-25

            計算機二級C++考點:C++語言概述07-17

            計算機二級C語言真題04-16

            計算機二級C語言考試技巧05-25

            計算機二級C語言試題及答案05-19

            計算機二級C語言筆試題01-03

                    <pre id="bbfd9"><del id="bbfd9"><dfn id="bbfd9"></dfn></del></pre>

                    <ruby id="bbfd9"></ruby><p id="bbfd9"><mark id="bbfd9"></mark></p>

                    <p id="bbfd9"></p>

                    <p id="bbfd9"><cite id="bbfd9"></cite></p>

                      <th id="bbfd9"><form id="bbfd9"><dl id="bbfd9"></dl></form></th>

                      <p id="bbfd9"><cite id="bbfd9"></cite></p><p id="bbfd9"></p>
                      <p id="bbfd9"><cite id="bbfd9"><progress id="bbfd9"></progress></cite></p>
                      飘沙影院