ywtl.net
当前位置:首页>>关于图形时钟用C语言怎么编?的资料>>

图形时钟用C语言怎么编?

#include #include #include void Draw(int hour, int minute, int second){ double a_hour, a_min, a_sec; // 时、分、秒针的弧度值 int x_hour, y_hour, x_min, y_min, x_sec, y_sec; // 时、分、秒针的末端位置 int x_hour1,y_hour1,x_min1,y...

#include #include #include #include #include #define PI 3.1415926 int main() { int X=300,Y=250,R=100,RR=130; int X_HOUR,X_MINUTE,X_SECOND; int Y_HOUR,Y_MINUTE,Y_SECOND; int X_DRAW=0,Y_DRAW=0,R_DRAW=120; int NUM=0; struct time T...

/* Note:Your choice is C IDE */ #include "stdio.h" #include "graphics.h" #include "math.h" #include "time.h" #include "dos.h" #include "stdlib.h" #include "conio.h" #define R 200 #define PI 3.1415926 #define X(a,b,c) x=a*cos(b*...

#include //.....int timerID;void CALLBACK TimerProc(HWND hwnd, UINT message, UINT idTimer, DWORD dwTime){ //....}int main(){ timerID=SetTimer(NULL,001,speed,TimerProc); //speed为间隔毫秒数 MSG msg; while(GetMessage(&msg,NULL,0,...

这是我用C语言写的 需要采用EasyX图形库,绘制方法很简单,只需要根据时间,算出指针的偏转角度,然后从中心点向外画长度不等的线即可

c语言时钟程序代码如下: #include #include #define ID_TIMER 1//计时器ID #define TWOPI (2*3.14159) LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM); int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR szCmdLine,...

我希望你只是需要如何知道时间,而不是写你一个时钟程序,那个太复杂了,如果只是想如何知道时间- #include #include int main(void) { struct tm *tm_ptr; time_t the_time; (void)time(&the_time); tm_ptr=localtime(&the_time); printf("Date...

//图形库是EGE,下载后配置一下#include #include "graphics.h"#include #include #include #define x0 210.0#define y0 210.0#define r 200.0POINT pt[60],pt_s[60],pt_m[60],pt_h[60],pt1[60];using namespace std;int main(){initgraph(420,4...

简单模拟图形时钟代码如下: graphics.hVC上编译通过 给TC上编译没问题VC行graphics.hVC上编译通过 #include"graphics.h" #include"math.h" #include"dos.h" #define pi 3.1415926 #define X(a,b,c) x=a*cos(b*c*pi/180-pi/2)+300 #define Y(a,b...

#include #include #include #define pi 3.1415926 #define X(a,b,c) x=a*cos(b*c*pi/180-pi/2) 300; #define Y(a,b,c) y=a*sin(b*c*pi/180-pi/2) 240; #define d(a,b,c) X(a,b,c);Y(a,b,c);line(300,240,x,y) void init() {int i,l,x1,x2,y1,y2...

网站首页 | 网站地图
All rights reserved Powered by www.ywtl.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com