形容街上人少的句子:很简单语言帮忙分析一下谢谢

来源:百度文库 编辑:中科新闻网 时间:2024/04/27 15:15:40
#include<stdio.h>
main()
{
char modes[5];
printf("%please enter the mode");
scanf("%s",modes);
printf(%s\n",modes);
}

问题是上面的示例程序所能完成的功能是:
答案是B将字符串直接输入数组中并输出!

本人对语言非常不明白,希望大家能用直白的话把这个编程给我解释解释,字母都啥意思啊,谢谢!
第五行写错了应该是
printf("\n please enter the mode");

顺便问下\n是什么意思啊?谢谢

#include<stdio.h> --------导入头文件
main()----------主函数
{
char modes[5];-----定义字符数组
printf("\n please enter the mode");
------ 先换行再屏幕输出please enter the mode
scanf("%s",modes);---键盘输入字符放到modes数组中
printf(%s\n",modes);----屏幕输入modes数组里的内容
}
\n是回车的意思

#include<stdio.h> --------导入头文件
main()----------主函数
{
char modes[5];-----定义字符数组
printf("%please enter the mode");
------屏幕输出 %please enter the mode
scanf("%s",modes);---键盘输入字符放到modes数组中
printf(%s\n",modes);----屏幕输入modes数组裏的内容
}

这个程序是有问题的

main() /*主函数*/
{
char modes[5];/*定义一个数粗*/
printf("%please enter the mode");/*提示用户输入数组*/
scanf("%s",modes); /*输入数组*/
printf(%s\n",modes); /*输出数组*/
}