这个程序错那了

来源:百度知道 编辑:UC知道 时间:2024/06/30 22:25:43
#include<stdio.h>
void mian()
{
long chosen=15;
int guess=0;
int count=3;
printf ("\n this is a guessing game".);
printf ("\n I have chosen a number between 1 and 20"
" which you must guess.\n");
for(; count>0;--count)
{
printf ("\n you have %d tr%s left,count ,count==1?"y";"ies");
printf ("\n enter a guess;");
scanf ("%d",&guess"):
if (guess==chosen)
{
printf ("\n you guessed it !\n");
return;
}
if(guess<1 || guess > 20)
printf (" I said between 1 and 20.\n");
else
printf("sorry , %d is wrong.\n"."guess");
}
printf ("\n you have had three tries and failed,the number was %d\n",chosen);
printf("\nyou have

#include<stdio.h>
#include<iostream.h>
void mian()
{
long chosen=15;
int guess;
int count=3;
printf ("\n this is a guessing game");
printf ("\n I have chosen a number between 1 and 20"
" which you must guess.\n");
for(; count>0;--count)
{
printf ("\n you have %d tr%s left,count ,count==1""y","ies");
printf ("\n enter a guess;");
scanf ("%d",&guess);
if (guess==chosen)
{
printf ("\n you guessed it !\n");
return;
}
if(guess<1 || guess > 20)
printf (" I said between 1 and 20.\n");
else {
printf("sorry , %d is wrong.\n","guess");
}
}
printf ("\n you have had three tries and failed,the number was %d\n",chosen);
}

输出语句有n多错误.
printf