8、设计下列伪码程序的满足判定覆盖的测试用例. START INPUT (A,B,C)IF A+B>5 THEN X=10 ELSE X=1END IFIF B>10 THEN Y=20 ELSE Y=2END IF IF C>15 THEN Z=30 ELSE Z=3END IF PRINT (X,Y,Z)STOP
2019-04-19
8、设计下列伪码程序的满足判定覆盖的测试用例. START INPUT (A,B,C)
IF A+B>5
THEN X=10
ELSE X=1
END IF
IF B>10
THEN Y=20
ELSE Y=2
END IF
IF C>15
THEN Z=30
ELSE Z=3
END IF
PRINT (X,Y,Z)
STOP
优质解答
#include
void main()
{
int A,B,X,Y;
scanf("%d%d",&A,&B);
X = A < 5 10 :1;
Y = B < 10 2 :20;
printf("X=%d,Y=%d",X,Y);
}
#include
void main()
{
int A,B,X,Y;
scanf("%d%d",&A,&B);
X = A < 5 10 :1;
Y = B < 10 2 :20;
printf("X=%d,Y=%d",X,Y);
}