你能告诉我你得到这种输出的原因吗? [英] can u tell me the reason that y we get this types of outputs
问题描述
program1:1
main()
{
printf(" trip"" trapas");
}
输出:行程陷阱
prog 2:
main( )
{
prinf(5+bangalore);
}
输出:lore
prog:3
main()
{
n = 5;
printf(" \\\
n =%* d",n,n);
}
输出:5
program1 :1
main()
{
printf("trip" "trapas");
}
output:trip traps
prog 2:
main()
{
prinf(5+ "bangalore");
}
output:lore
prog: 3
main()
{
n=5;
printf("\n n=%*d",n,n);
}
output:5
推荐答案
vinayakapuram schrieb:
vinayakapuram schrieb:
program1:1
main ()
{
printf(trip,trapas);
}
输出:行程陷阱
我不相信。
prog 2:
main()
{
prinf(5+" bangalore");
}
输出:绝杀
我也不相信。然而,应该有来自编译器和链接器的一些消息,关于''prinf''
prog:3
main()
{
n = 5;
printf(" \\\
n =%* d",n,n);
}
输出:5
program1 :1
main()
{
printf("trip" "trapas");
}
output:trip traps
I don''t believe it.
prog 2:
main()
{
prinf(5+ "bangalore");
}
output:lore
I don''t beleive this either. Yet, there should be some messages from
the compiler and the linker about ''prinf''
prog: 3
main()
{
n=5;
printf("\n n=%*d",n,n);
}
output:5
为什么说实话这么难?你连续三次说谎。
Why is it so hard to tell the truth? You are lieing 3 times in a row.
vinayakapuram写道:
vinayakapuram wrote:
program1:1
main()
{/> printf(" trip"" trapas");
}
输出:行程陷阱
" ; str1 " STR2"通常用于连接两个常量字符串
你的代码应该打印没有空格的triptrapas。
prog 2:
main()
{
prinf(5+bangalore);
}
输出:lore
因为printf接受一个char *(指针地址)并且你给了一个
偏移5到该地址。 prog:3
main()
{
n = 5;
printf(" \\\
n =%* d",n,n);
}
输出:5
program1 :1
main()
{
printf("trip" "trapas");
} output:trip traps
"str1 " "str2" is often used to conctenate two constant strings
your code should print triptrapas without the space.
prog 2:
main()
{
prinf(5+ "bangalore");
}
output:lore because printf accepts a char* (pointer address) and you are giving an
offset of 5 to that address. prog: 3
main()
{
n=5;
printf("\n n=%*d",n,n);
}
output:5
printf接受多个参数并忽略如果替换不是
找到...
除了写得很差外,你的代码不可编辑
而无需修改。请尝试发布可编辑的代码。
printf accepts multiple parameters and ignores if a substitution is not
found ...
Apart from being very poorly written, you code was not compilable
without modifications. Please try to post compilable code.
(请注意,英语中没有单词u和y。) />
vinayakapuram写道:
(Note that there are no words "u" and "y" in the English language.)
vinayakapuram wrote:
program1:1
main()
{/> printf( trip,trapas);
}
输出:行程陷阱
更可能的是,triptrapas,如上所述是这样的:
printf(" triptrapas");
prog 2:
main()
{
prinf(5+bangalore);
}
输出:绝杀
提示0:printf的正确拼写是什么?
提示1:表达式的值是什么5 +bangalore
提示2:加法是可交换的。
prog:3
main()
{
n = 5;
printf(" \\\
n =%* d",n,n);
}
输出:5
program1 :1
main()
{
printf("trip" "trapas");
}
output:trip traps
More likely, "triptrapas", as the above is the same as:
printf("triptrapas");
prog 2:
main()
{
prinf(5+ "bangalore");
}
output:lore
Hint 0: What is the proper spelling of "printf"?
Hint 1: What is the value of the expression 5+"bangalore"
Hint 2: Addition is commutative.
prog: 3
main()
{
n=5;
printf("\n n=%*d",n,n);
}
output:5
实际上,上述内容无效,因为您从未声明n。但是,
假设你的确意味着int n = 5; ...
因为n是5.您对输出的期望是什么?
但是,我怀疑输出真的是换行后跟
" n = 5
-
+ ----------------------- - + -------------------- + -------------------------- --- +
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody / at\spamcop.net | www.fptech.com | #include< std_disclaimer.h> |
+ ------------------------- + -------------- ------ + ----------------------------- +
不要给我发电子邮件:< mailto:Th ************* @ gmail.com>
Actually, the above is invalid, as you never declare "n". However,
assuming you really meant "int n=5;" ...
Because n is 5. What would you expect the output to be?
However, I suspect that the output is really a newline followed by
" n= 5"
--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don''t e-mail me at: <mailto:Th*************@gmail.com>
这篇关于你能告诉我你得到这种输出的原因吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!