好文档 - 专业文书写作范文服务资料分享网站

C++大学教程习题解答(第七版) 

天下 分享 时间: 加入收藏 我要投稿 点赞

cout << setw( 10 ) <<\<> choice;

NewQuestion(num1,num2,choice); cin>> Result;

while ( Result != num1* num2 ) ++Wcounter1;

int Wcase = 1 + rand() % 4; switch( Wcase ) { case 1: }

//cout << \ cin >> Result;

if ( Wcounter1 + Rcounter2 == 10 ) goto next;

++Rcounter2; //right number. int Rcase = 1 + rand() % 4; switch( Rcase ) { case 1:

cout << \<<\<

cout << \<<\<

cout << \<

cout << \<

cout << \<

cout << \<

{ }

loop:

if ( Wcounter1 + Rcounter2 == 10 )break;

case 2:

case 3:

case 4:

default:

case 2:

}

case 3:

cout << \<<\<

cout << \<<\<

case 4:

default:

//cout << \ NewQuestion(num1,num2,choice); cin>> Result; goto loop;

if( Rcounter2/10.0 <0.75 )

cout << \;

next:

else

if( Rcounter2/10.0 >=0.75 )

cout << \;

void NewQuestion(int& int1,int& int2,int Choice ) { } 6.60

#include #include #include #include #include using namespace std;

void NewQuestion(double&,double&,int); double Resultvalue(double,double,int );

if (Choice =1 ) { }

if(Choice =2 ) { }

cout << setw( 5 ) << int1 << \ << int2 << \;

int1 = 0 + rand( ) % 20; int2 = 0 + rand( ) % 20;

int1 = 0 + rand( ) % 10; int2 = 0 + rand( ) % 10;

int main( ) {

NewQuestion(num1,num2,choice); cin>> Result;

while ( Result != Resultvalue(num1,num2 ,choice )) ++Wcounter1;

int Wcase = 1 + rand() % 4; switch( Wcase ) { case 1:

cout << \<

cout << \<

cout << \<

cout << \<

{

double num1; int choice; int choice1; double Result; double Wcounter1 = 1; double Rcounter2 = 0; srand( time( 0 ) );

cout << setw( 10 ) <<\<> choice1; choice = choice1; if ( 5 == choice1 )

choice = 1 + rand ( ) % 4 ;

double num2;

practice:\<<\混¨?合? ) ) \;

loop:

if ( Wcounter1 + Rcounter2 == 10 )break;

case 2:

case 3:

case 4:

default:

}

void NewQuestion(double& int1,double& int2,int Choice ) {

int1 = 0 + rand( ) % 10; int2 = 1 + rand( ) % 10; }

if ( Wcounter1 + Rcounter2 == 10 ) goto next;

++Rcounter2; //right number. int Rcase = 1 + rand() % 4; switch( Rcase ) { case 1:

cout << \<<\<

cout << \<<\<

cout << \<<\<

cout << \<<\<

//cout << \ cin >> Result;

case 2:

case 3:

case 4:

default:

//cout << \ choice = 1 + rand ( ) % 4 ; NewQuestion(num1,num2,choice); cin>> Result; goto loop;

if( Rcounter2/10.0 <0.75 )

cout << \;

if ( 5 == choice1 )

next:

else

if( Rcounter2/10.0 >=0.75 )

cout << \;

}

switch( Choice ) { case 1 : }

cout << setw( 5 ) << int1 << \ << int2 << \; break;

cout << setw( 5 ) << int1 << \ << int2 << \; break;

cout << setw( 5 ) << int1 << \ << int2 << \; break;

cout << setw( 5 ) << int1 << \ << int2 << \; break; break;

case 2 :

case 3 :

case 4 :

default :

double Resultvalue(double number1,double number2 ,int choice ) { }

switch( choice ) { case 1: }

return number1 + number2 ; break;

return number1 - number2 ; break;

return number1 * number2 ; break;

return number1 / number2 ; break; break;

case 2:

case 3:

case 4:

default:

C++大学教程习题解答(第七版) 

cout<choice;NewQuestion(num1,num2,choice);cin>>Result;while(Result!=num1*num2
推荐度:
点击下载文档文档为doc格式
8lwww86r4o862m61dk4v721et5ixox005np
领取福利

微信扫码领取福利

微信扫码分享