标签:
1.三元操作符
#include<stdio.h>
main()
{
int score;
char grade;
printf("input your score");
scanf("%d",&score);
grade = score >= 90?‘A‘:(score >= 60?‘B‘:‘C‘);
printf ("%dbelong is %c",score, grade);
}
三元操作符从左往右依次运算,比较运算符的优先级大于赋值符号。
-----------------------------------------------------------------------
标签:
原文地址:http://www.cnblogs.com/-zhh/p/5116893.html