#include<stdio.h>
int main()
{
int a,b,c,d,e,f;
a=0;
printf("如果生日有以下数字,请输入\"1\"\n");
printf("1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31\n");
scanf("%d",&b);
if(b==1) a=a+1;
printf("2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31\n");
scanf("%d",&c);
if(c==1) a=a+2;
printf("4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31\n");
scanf("%d",&d);
if(d==1) a=a+4;
printf("8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31\n");
scanf("%d",&e);
if(e==1) a=a+8;
printf("16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31\n");
scanf("%d",&f);
if(f==1) a=a+16;
printf("a=%d",a);
return 0;
}
我想把上面的1换成“yes”要怎么操作?
int main()
{
int a,b,c,d,e,f;
a=0;
printf("如果生日有以下数字,请输入\"1\"\n");
printf("1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31\n");
scanf("%d",&b);
if(b==1) a=a+1;
printf("2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31\n");
scanf("%d",&c);
if(c==1) a=a+2;
printf("4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31\n");
scanf("%d",&d);
if(d==1) a=a+4;
printf("8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31\n");
scanf("%d",&e);
if(e==1) a=a+8;
printf("16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31\n");
scanf("%d",&f);
if(f==1) a=a+16;
printf("a=%d",a);
return 0;
}
我想把上面的1换成“yes”要怎么操作?