问题描述:利用if……else语句实现密码输入,如果输入整数8888,显示Congratuation!,输入其他整数,显示Sorry!
#include <stdio.h>
int main(void){
int key;
printf("Passnumber=");
scanf("%d",&key);
if(key==8888){
printf("Congratuation!\n");
}else{
printf("Sorry!");
}
return 0;
}
问题描述:利用if……else语句实现密码输入,如果输入整数8888,显示Congratuation!,输入其他整数,显示Sorry!
#include <stdio.h>
int main(void){
int key;
printf("Passnumber=");
scanf("%d",&key);
if(key==8888){
printf("Congratuation!\n");
}else{
printf("Sorry!");
}
return 0;
}