计算机二级c语言一般多少分过关,计算机二级考试c语言过关经验

计算机二级考试c语言过关经验

/* 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语言过关经验】相关文章:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值