#include"graphics.h"#include"math.h"#define PI 3.14void main(){ int x1=50,y1=60,x2=120,y2=100,a=0; void *buf; int size,i,n=1; int gdriver=DETECT,gmode; initgraph(&gdriver,&gmode," "); setbkcolor(BLUE); setcolor(YELLOW); rectangle(x1,y1,x2,y2); circle(x1+10,y2+5...
#include "stdio.h" /* 标准输入输出库 */#include "string.h" /* 字符串操作函数库 */#include "math.h" /* 数学函数库 */#include "stdlib.h" /* 标准函数库 */#include "graphics.h" /* 图形函数库 */#include "bios.h" /* 基本输入输出系统函数库*/#include "dos.h" /* dos函数库 */#define NU...
输出内容:*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
#include "stdio.h"main(){ int i,j;for(i=0;i<5;i++){ for(j=5;j>i;j--) printf("*+"); printf("\n");}getch();}
#include<stdio.h>#include<time.h>main(){int h,b,k,i;h=0;b=0;for (i=0;i<500;i++){ k=rand()%7+1; if(k<=3) h++; else b++; } printf("hongqiuyou%d\n",h); printf("baiqiuyou%d\n",b); getch();}
// 模拟摸球 500 回,每回 3 次,摸到 1、3、5、7 为白球, 2、4、6、8 为红球#include<stdio.h>#include<time.h>#define N 500.0int main(void){ int ball[3]; int ball_white; int ball_red; int i; ball_white=ball_red=0; srand(time(NULL)); for(i=0;i<500;++i) { int j; int k; for(j=0;j...
#include "stdio.h"int xxx(int b){int x=b%2,y=b/2;if(b!=0){ x=x+xxx(y)*10; return x;}}main(){int a,c;scanf("%d",&c);a=xxx(c);printf("%d",a);getch();}
#include<stdio.h>#include<string.h>#define N 33long two_ten( const char * ,int);long num;int main(void){ char str[N]; long ten; while(1) { num=0; fgets(str,N,stdin); if(str[0]=='0') { printf("ten=0\n"); break; } s...