2025-03-06 23:47:59 +08:00

23 lines
497 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*-------------------------------------------------------
功能从键盘输入2个整数相加再输入答案如果正确显示"right",否则显示"error"。
--------------------------------------------------------*/
#include "stdio.h"
main( )
{
int a,b,c;
printf("please input a and b:\n");
scanf("%d,%d",&a , &b);
printf("please input the answer:\n");
scanf("%d",&c);
/**********Program**********/
if(a+b==c)
/********** End **********/
printf("right\n");
else
printf("error\n");
}