#include <stdio.h> #include <stdlib.h> #define M 20 //假设这个数为20 int main() { int n; int temp=0;//标志位 printf("Please enter the number:\n");//提示用户输入一个数 scanf("%d",&n); if (n<M)//如果小于,就置1 temp=1; else temp=0;//不是的,就置0 printf("the answer is :%d\n",temp);//输出结果 system("pause"); return 0; }
#include<stdio.h> void main() { int N,i; printf("input the O number:\n"); scanf("%d",&N); printf("input the D number:\n"); scanf("%d",&i); if(i>N) printf("1"); else printf("0"); }