求高手帮忙看一下这道C语言判断一个整数的奇偶性,哪错了。

[复制链接]
查看11 | 回复2 | 2011-2-8 15:32:38 | 显示全部楼层 |阅读模式
#include
void main()
{int a;
scanf("%d",a);
if(a%2)
printf("shijishu\n");
else
printf("shioushu\n");}

回复

使用道具 举报

千问 | 2011-2-8 15:32:38 | 显示全部楼层
#include void main(){int a;scanf("%d",&a);//取地址if(a%2)printf("shijishu\n");elseprintf("shioushu\n");}
回复

使用道具 举报

千问 | 2011-2-8 15:32:38 | 显示全部楼层
scanf("%d",a);整形输入scanf("%d",&a);a%2==0是偶数!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行