Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Computer programming is urgent ~ ~ ~
Computer programming is urgent ~ ~ ~
# include & ltiostream.h & gt

Use namespace std// You are not using a namespace. There must be some mistake.

void main()

{int score;

Cout & lt& lt "Enter your score"<& ltendl

CIN & gt; & gt score;

if(score & gt; 100 || Score & lt0)// You didn't judge the input number range.

{cout & lt& lt "error"<& ltendl.

Return;

}

cout & lt& lt" score = " & lt& lt":" & lt& ltendl

Switch(score/ 10)// The original switch was improperly used.

{Case 9: Cout <; & lt" A "<& ltendl breaks;

Case 8: Cout <; & lt“B”& lt; & ltendl breaks;

Case 7: Cout <; & lt" C "<& ltendl breaks;

Case 6: Cout <; & lt" D "<& ltendl breaks;

Default value: cout < < "f" <; & ltendl// There is something wrong with the original logic. A score below 60 should be F.

}

Return;

}