[心得] 強者我同學
#include <stdio.h>
#include <stdlib.h>
int main(void)
{ int sex;
printf("請輸入整數(1是男性,0是女性):>");
scanf("%d",&sex);
if(sex==0)
{ printf("女生!\n");
}
if(sex==1)
{ printf("男生!\n");
}
if((sex|=0)&&(sex|=1))
{ printf("輸入資料錯誤!\n");
}
system("pause");
return(0);
}
x
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.136.162.156
推
10/22 14:40, , 1F
10/22 14:40, 1F
→
10/22 14:42, , 2F
10/22 14:42, 2F
推
10/22 14:44, , 3F
10/22 14:44, 3F
噓
10/22 14:54, , 4F
10/22 14:54, 4F