
当然可以使用windows.h,windows.h中
定义了与windows
系统相关的
函数, 如下例子: #include <stdio.h>#include <stdlib.h>#include <Windows.h> int main() { SYSTEMTIME sys_time// SYSTEMTIME的定义就需要windows.h GetLocalTime( &sys_time ) printf( "%4d/%02d/%02d %02d:%02d:%02d.%03d 星期%1d\n",sys_time.wYear, sys_time.wMonth, sys_time.wDay, sys_time.wHour, sys_time.wMinute, sys_time.wSecond, sys_time.wMilliseconds, sys_time.wDayOfWeek) system("time") system("pause") return 0 } 其实windows系统本身底层也是标准C写的
记得采纳啊
//因为windows.h里有max函数,冲突了,
//所以以下的max全部更名为max11就解决了
#include<stdio.h>
#include<windows.h>
void main()
{
int max11(int x,int y)
int a,b,c
printf("please input two number:")
scanf("%d,%d",&a,&b)
c=max11(a,b)
printf("max is %d\n",c)
system("pause")
}
int max11(int x,int y)
{
int z
if(x>y)
z=x
else
z=y
return(z)
}
评论列表(0条)