Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Matlab input a percentile level, which requires output levels, a, b, c, d, e.
Matlab input a percentile level, which requires output levels, a, b, c, d, e.
# include & ltstdio.h & gt

int main()

{

Int score;

Printf ("Enter student grades: \ n");

Scanf("%d ",& score);

If (score & lt0 || score & gt 100)

{

Printf ("The data entered is illegal! \ n ");

}

other

{

Switch (fraction/10)

{

Case 0:

Case 1:

Case 2:

Case 3:

Case 4:

Case 5: printf ("This student's grade is: E \ n"); Break;

Case 6: printf ("This classmate's grade is D \ n"); Break;

Case 7:printf ("This student's grade is: c \ n"); Break;

Case 8: printf ("This student's grade is: b \ n"); Break;

Case 9:

Case 10:printf ("This student's grade is: A \ n"); Break;

}

}

Return? 0;

}

Extended data:

Input and output of matlab

The output statement is a very simple disp ('Yes, of course')?

In this case, of course, you can output yes.

If you want to output a variable, just output the variable name to disp (variable name).

About input:?

There is nothing to say about input, just input.

For example: enter ('Please enter an integer')?

In this case, it will output a sentence: Please enter an integer, and then you can enter a numerical value?

At the same time, it should be said that input also has a return value, which can return two types: number or string. number has defaulted, and string has no default, so it needs to be declared by itself. Like what?

X = input ('Yes, of course'); Can you return a number?

X = input ('Please enter a string',' s'); Returns a string

The specific operation in Matlab is given.

Input ("such an instance");

X = input ('Please enter an integer');

X = input ('Please enter a string',' s');

Disp ('invincible in Chinese');

disp(x);