啊哈磊_编程从这里起步
标题:
那个if和else的……
[打印本页]
作者:
ly1011685524
时间:
2014-2-8 16:53
标题:
那个if和else的……
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a;
scanf("%d",&a);
if("a%2==0") printf("yes");
else printf("no");
system("pause");
return 0;
}
一直输出yes……哪里错了
作者:
超神级
时间:
2014-2-8 16:53
if("a%2==0")那个老师教的!小生佩服!if(a%2==0)
if(“a%2==0”)吧他当做字符返回且不为0为真输出YES
作者:
4399APPLE
时间:
2014-2-10 20:12
LZ,如果答案满意请选择最佳答案哦~~~
作者:
baibian11
时间:
2014-2-16 17:16
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a;
scanf("%d",&a);
if (a%2==0) printf("yes"); 如果的(A%2==0)这里不用“”
else printf("no");
system("pause");
return 0;
}
作者:
葛奕成
时间:
2014-2-17 17:12
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a;
scanf("%d",&a);
if (a%2==0) printf("yes"); 如果的(A%2==0)这里不用“”
else printf("no");
system("pause");
return 0;
}
作者:
葛奕成
时间:
2014-2-17 17:12
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a;
scanf("%d",&a);
if (a%2==0) printf("yes"); 如果的(A%2==0)这里不用“”
else printf("no");
system("pause");
return 0;
}
作者:
LeoGuozichuan
时间:
2014-2-21 21:58
if("a%2==0") printf("yes");
//这谁教的,应该是
if(a%2==0) printf("yes");
好的回复是对人的鼓励。
复制代码
作者:
风流种
时间:
2014-3-6 14:59
对7楼赞一个,其他楼主也不错
欢迎光临 啊哈磊_编程从这里起步 (https://bbs.codeaha.com/)
Powered by Discuz! X3.2