已解决求助!一个C语言小程序.
提问者:qqq8392630 | 浏览次 | 提问时间:2017-01-29 | 回答数量:9
有道例题:有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
回答数:5 | 被采纳数:23
如果i不等于k且i不等于j且j不等于k
maoqiu199911
回答数:211 | 被采纳数:35
--------------------Configuration: u - Win32 Debug--------------------
Compiling...
u.c
C:\Documents and Settings\Administrator\桌面\u.c(6) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(6) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(6) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(6) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(6) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(6) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(7) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(7) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(7) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(7) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(8) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(8) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(8) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(8) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(9) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(9) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(9) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(9) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(9) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(9) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(10) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(11) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(11) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(11) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(11) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(11) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(11) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(11) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(11) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(12) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(12) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(12) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(12) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(12) : error C2018: unknown character '0xa1'
C:\Documents and Settings\Administrator\桌面\u.c(12) : error C2018: unknown character '0xa1'
执行 cl.exe 时出错.
u.obj - 1 error(s), 0 warning(s)
怎么我编译时,会出错的!
huaming119
回答数:15 | 被采纳数:90
也就是说应该是:
if (i!=k && i!=j && j!=k)这么分开吧,唉,对运算符的优先级还是有点晕哈。
3楼的朋友,不知道你编译完怎么成了那样,是不是跟你将它放在桌面上了有关系?
我也纳闷3楼的朋友怎么会出现那种情况,谁能给解答下~~~
if (i!=k&&i!=j&&j!=k) 表示i不等于k且i不等于j且j不等于k 也就是各数字不重复."!="表示不等于的意思
第一次回答问题,不知道,你是否满意
星馨genie
回答数:217 | 被采纳数:38
忘了说了
运算符的优先级:从高到低 !--算数运算符--关系运算符--&&--||--赋值运算符