当前位置:系统粉 > 电脑问答 > 其他问答 > 求助!一个C语言小程序.

求助!一个C语言小程序.

提问者:qqq8392630  |  浏览 次  |  提问时间:2017-01-29  |  回答数量:9

求助!一个C语言小程序.有道例题:有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少? 程序如下: main() { int i,j,k; printf(\"\\n\"); for(i=1;i<5;i++)     for(j=1;j<5;j++)    for (k=1;k<5;k++)    {     if (i!=k&&i!=j&&j!=k)         printf(\"%d,%d,%d\\n\",i,j,k);    } } 对于其中的:if (i!=k&&i!=j&&j!=k) 这句不太明白,请高手解答下!

已有9条答案
柚子407405158

柚子407405158

回答数:5  |  被采纳数:23

2017-01-29 17:45:31
如果i不等于k且i不等于j且j不等于k
赞 0
maoqiu199911

maoqiu199911

回答数:211  |  被采纳数:35

2017-01-29 21:16:07
--------------------Configuration: u - Win32 Debug--------------------
Compiling...
u.c
C:\Documents and Settings\Administrator\桌面\u.c(6) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(6) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(6) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(6) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(6) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(6) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(7) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(7) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(7) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(7) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(8) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(8) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(8) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(8) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(9) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(9) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(9) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(9) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(9) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(9) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(11) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(11) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(11) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(11) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(11) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(11) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(11) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(11) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(12) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(12) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(12) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(12) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(12) : error C2018: unknown character &#39;0xa1&#39;
C:\Documents and Settings\Administrator\桌面\u.c(12) : error C2018: unknown character &#39;0xa1&#39;
执行 cl.exe 时出错.

u.obj - 1 error(s), 0 warning(s)


怎么我编译时,会出错的!
赞 21
飞雪溅影

飞雪溅影

回答数:63  |  被采纳数:86

2017-01-29 22:50:35
哈哈,这么搞笑?
赞 6
huaming119

huaming119

回答数:15  |  被采纳数:90

2017-01-29 17:48:01
也就是说应该是:
if (i!=k && i!=j && j!=k)这么分开吧,唉,对运算符的优先级还是有点晕哈。
3楼的朋友,不知道你编译完怎么成了那样,是不是跟你将它放在桌面上了有关系?
赞 1
林爱新兰

林爱新兰

回答数:70  |  被采纳数:88

2017-01-29 17:16:33
你是不是用了全角标点?
赞 7
汝鄢倩

汝鄢倩

回答数:32  |  被采纳数:37

2017-01-29 22:14:23
看不懂哦·55
赞 3
死神之梦无痕

死神之梦无痕

回答数:20  |  被采纳数:121

2017-01-30 08:47:12
我也纳闷3楼的朋友怎么会出现那种情况,谁能给解答下~~~
赞 2
神炮ty

神炮ty

回答数:143  |  被采纳数:119

2017-01-29 18:47:01
if (i!=k&&i!=j&&j!=k)  表示i不等于k且i不等于j且j不等于k 也就是各数字不重复."!="表示不等于的意思
第一次回答问题,不知道,你是否满意
赞 14
星馨genie

星馨genie

回答数:217  |  被采纳数:38

2017-01-30 05:00:11
忘了说了
运算符的优先级:从高到低 !--算数运算符--关系运算符--&&--||--赋值运算符
赞 21
解决方法
版权信息

Copyright @ 2011 系统粉 版权声明 最新发布内容 网站导航