实验三 多分支语句【新】
【目的】
1、熟悉多分支语句应用;
2、掌握各种运算符及优先级;
3、掌握关系表达式、逻辑表达式的应用。
【内容】
http://www.marcool.net/home/problem.htm?problemID=22
http://www.marcool.net/home/problem.htm?problemID=23
http://www.marcool.net/home/problem.htm?problemID=25
http://www.marcool.net/home/problem.htm?problemID=26
http://www.marcool.net/home/problem.htm?problemID=27
code27
#include<stdio.h> #include<stdlib.h> int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); if(abs(a-b)<=2 && abs(b-c)<=2 && abs(c-a)<=2 && (a-b)*(b-c)*(c-a)!=0)printf("TRUE\n"); else printf("FALSE\n"); return 0; }

浙公网安备 33010602011771号