博文
求闰年(2005-09-18 01:42:00)
摘要:#include <stdio.h>
void main()
{int year,leap;
printf ("Enter year:");
scanf("%d",&year);
if (year%400 == 0) leap =1; /*是闰年leap 置成1*/
else
{ if (year%4 ==0 && year%100!=0) leap=1;
else leap=0; /*不是闰年leap 置成0*/
}
if (leap==1) printf ("%d: is a leap year.",year);
else printf ("%d is not a leap year", year);
getch();
}
......
泡泡堂(2005-09-18 01:41:00)
摘要:/*
(单机两人对站版,编译器:TC 2.0)
双击PAOPAO.EXE运行,如果不是全屏的话,请按Alt+Enter键使它变成全屏。
玩家一:黄色的笑脸
向上: w
向下: s
向左: a
向右: d
放泡泡:空格
玩家二:红色的笑脸
向上: UP(方向键)
向下: DOWN
向左: LEFT
向右: RIGHT
放泡泡:回车
退出:
&n......
俄罗撕方快(2005-09-18 01:41:00)
摘要:/*-------------------------------------------------------*/
/* sunwise 整理于 2002/5/27/14:35 Original 1999 */
/* */
/*-------------------------------------------------------*/
/*------------- Compile ------------------------------ */
/* [in os mode:] */
/* bgiobj egavga &......
QQ等级计算程序(2005-09-18 01:32:00)
摘要:#include<math.h>
tian(int x)
{
int y;
if (x<=48&&x>0) /*输入的等级数要小于等于48或大于0,否则不合QQ要求*/
{
y=x*x+4*x;
return y;
}
else return 0;
}
deng(int y)
{
int x,i,a[49],max;
if (y>2496||y<=0) /*输入的天数要小于等于48级对应的2496天并大于0*/
return 0;
for(x=1;x<=48;x++)
if (x*x+4*x==y)
break;
if (x==49) /*因为在上面的循环里用了x++,所如果没有一个等级符合要求,那么X值会变为49*/
{
for(x=1,i=1;x<=48&&i<=48;x++,i++)
a[i......
用Gauss列主元消元法解线性方程组(2005-09-18 01:29:00)
摘要: #include<math.h>
#include<stdio.h>
#define NUMBER 20
#define Esc 0x1b
#define Enter 0x0d
float A[NUMBER][NUMBER+1] ,ark;
int flag,n;
exchange(int r,int k);
float max(int k);
message();
main()
{
float x[NUMBER]; /*此数组用于存放方程解*/
int r,k,i,j;
char celect;
clrscr();
printf("\n\n用Gauss列主元消元法解线性方程组");
printf("\n\n1.解方程组请按Enter.");
printf("\n\n2.退出程式请按Esc.");
celect=getch();
if(celect==Esc)
exit(0);
printf("\n\n 输入方程组的维数:n=");
scanf("%d",&n);
printf(" \n\n现在输入系数矩阵A和向量b:");
for(i=1;i<=n;i++)
{
printf("\n\n请输入a%d1--a%d%d系数和向量b%d:",i,i,n,i);
/*实现将每一行中的系......
图形(2005-09-18 01:28:00)
摘要:#include <stdio.h>
#include <conio.h>
#include <math.h>
#include <graphics.h>
#define Pi 3.1415926
main()
{ int gdriver=DETECT,gmode;
float i,j;
int k;
float a,b,c;
float mid,m,x,y,z;
float u,v;
int col1,col2;
printf("enter the color value :");
scanf("%d %d",&col1,&col2);
initgraph(&gdriver,&gmode,"");
cleardevice();
for(i=0;i<=1.91;i+=1.91/75)
{
for(j=0;j<=21.6;j+=21.6/150)
{
for(k=1;k<=200;k++)
{
c=j;
a=sqrt(60*c)*cos(k*Pi/180*1.8);
 ......
图象(2005-09-18 01:28:00)
摘要:#include<math.h>
#include<graphics.h>
#define PI 3.14159
#define D 100
main()
{ float a,e,x1,y1,x2,y2;
int gdriver=VGA,gmode=VGAHI;
initgraph(&gdriver,&gmode,"d:\\tc");
cleardevice();
gotoxy(26,26);
printf("感谢使用由第九组成员编写的程序\n");
printf("组长:刘明明\n");
printf("成员:刘刚,申时永,张琴,简孝文\n");
setcolor(GREEN); setbkcolor(0);
for(a=0.0;a<2*PI;a+=2*PI/720)
{
e=D*(1+sin(4*a));
x1=320+e*cos(a);
x2=320+e*cos(a+PI/5);
y1=240+e*sin(a);
y2=240+e*sin(a+PI/5);
line(x1,y1,x2,y2);
}
getch();
closegraph(); } ......
万年历(2005-09-18 01:27:00)
摘要:#include <stdio.h>
main()
{
void print_head(int x,int y); /*打印头文件*/
void print_month(int x,int y); /*打印月历*/
int days_of_month(int x,int y); /*计算指定年月的天数*/
int leap(int x,int y); /*计算指定年月1号是星期几*/
int i,days,year,month,firstday;
char choose;
do
{printf ("\n\nplease input the year(0000~9999):\n\n");
scanf ("%d",&year);
if (year<0||year>9999) printf ("WANNING:ERROR,please input again!");}
while (year<0||year>9999);
printf ("\n\n");
do
{printf ("please input the month(0~12)\n\n\n");
scanf ("%d",&month);
&n......