c++的问题 谁能来帮帮我啊

来源:百度知道 编辑:UC知道 时间:2024/06/23 01:47:41
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <time.h>
void main(void)
{
int random1,random2,random3,random4,random5,random6,sum1,sum2,money,pay;

char reply;

money = 1000 ;

printf("your money is %d\n",money);

scanf("pls pls %d\n",&pay); {

srand( (unsigned)time( NULL ) );

random1=1+rand()%6;

random2=1+rand()%6;

random3=1+rand()%6;

sum1=random1+random2+random3;
printf("The number is %d\n",random1);
printf("The number is %d\n",random2);
printf("The number is %d\n",random3);
printf("The number is %d\n",sum1);

random4=1+rand()%6;

random5=1+rand()%6;

random6=1+rand()%6;

sum2=random4+random5+random6;
printf(&q

scanf("pls pls %d\n",&pay) 这里出错

改为: scanf("%d", &pay);

你将pls 和\n 放入scanf 做什么呢 虽然编译器查不出错来, 但这样是不正确 的

这是C吧

scanf("pls pls %d\n",&pay) 把pls pls \n去掉 改成scanf("%d",&pay)
有一次我为了这个问题查了半天的错 郁闷死了
还有你最后的选择语句不起作用 我给你改改

qq 387732471