请问谁可以写出以下程序的答案?谢谢啦!!

来源:百度知道 编辑:UC知道 时间:2024/06/10 22:41:36
模拟国际乒乓球公开赛记分系统。输入两名运动员姓名,循环每次延迟约两秒钟后,随机决定甲方或乙方得分,在屏幕同一位置上刷新记分。比赛采用11分制,但10:10之后,一方要净胜2分比赛才能结束

我不知道你要用什么语言写的 我就用VC++6.0给你写了个
#include<iostream.h>
#include<stdlib.h>
#include<conio.h>
#include<time.h>
#include<ctype.h>
#include<windows.h>
#include"stdio.h"
const MaxName=100;//队员最大姓名个数
const jushu=11;//局数
const tdsj=1;//间隔时间
struct player{
char name[MaxName];
int fenshu;
};

//时间延迟函数
void delay(int x)
{
time_t a1;
time_t a2;
// 得到开始时间
time(&a2);
do
{
time(&a1);
}
while ((a1 - a2) < x);
}
void main(){
int i;
int j;
int b;
char a;
player p1;
player p2;
while(1){
if(a=='n'||a=='N')
break;
p1.fenshu=0;
p2.fenshu=0;
cout<<"请输入队员1姓名不能大于"<<MaxName<<"个"<<endl;
gets(p1.name);
cout<<"请输入队员2姓名不