疑问1

# include "stdio.h"# include <conio.h> main ()/*函数名*/ {int n; /*定义变量*/ scanf("%d",&amp;n);/*录入*/ if(n%2==1)/*if语句*/printf("The odd\n");/*奇数*/ else;/*否则*/printf("The even\n");/*偶数*/getch(); } 如果录入的数据是偶数,那没问题,的确是输出“The even”。但是,如果录入的是奇数,输出的结果是“The od The even”。 问题何在呢? 啊!把else()后面那个分号去了,就嗷...
C++疑问 | 2010-11-07 19:33 | 阅读 433 次 | 评论 2 条
文章归档