44问答网
所有问题
用c语言实现输入hello world ? 输出 ? world hello 怎么编写代码
如题所述
举报该问题
推荐答案 2014-02-27
#include<stdio.h>
int main()
{
char a[99],b[99],c[99];
scanf("%s%s%s",a,b,c);
printf("%s %s %s\n",c,b,a);
return 0;
}
追问
比如有10个单词 那我是不是得定义10个数组呢? 有没有更优化的算法
追答
#include<stdio.h>
#include<string.h>
int main()
{
char str[99];
int i,j,a,b;
gets(str);
for(b=i=strlen(str)-1;i>=0;i--)
{
if(str[i]==' '||i==0)
{
a=i;
for(j=a;j<=b;j++)
printf("%c",str[j]);
b=a;
}
}
return 0;
}
温馨提示:答案为网友推荐,仅供参考
当前网址:
http://44.wendadaohang.com/zd/DG6RG3ZGKZGGVD6YDV.html
其他回答
第1个回答 2014-02-27
#include<stdio.h>
int main()
{
char a[99],b[99],c[99]; //定义三个字符串
scanf("%s%s%s",a,b,c);//输入三个字符串
printf("%s %s %s\n",c,b,a);//输出三个字符串
return 0;//返回
}
第2个回答 2014-02-27
码表
第3个回答 2014-02-27
#include<stdio.h>
int main()
{
char a[]="hello world";
printf("%s\n",&a);
return 0;
}
相似回答
c语言输出hello
world代码怎么写?
答:
最简单的C语言代就是输出“helloWord”,通常是作为初学编程语言时的第一个程序代码
。具体代码如下:include <stdio.h> int main(){ printf("Hello, World! \n");return 0;}
如何
在
用C语言实现输出
“
helloworld
“
答:
```c include int main() { printf("
hello
world
\n");return 0;} ```关于
C语言
的一些拓展信息如下:C语言是一种广泛使用的通用计算机编程语言,它在底层系统开发中非常流行。这种语言被设计成能够容易地编译、处理底层存储器,并生成尽可能少的机器
代码
,同时不需要任何运行环境的支持即可运行。尽管...
C语言输出hello
world怎么写
答:
int main(){ printf("
Hello
World
!\n");}
怎么编写C语言程序
,如:
Helloworld
的
?
答:
1、点击确定即可,创建出一个
helloworld
.
c
的小程序,然后我们就可以
编写
我们的
Hello
World
小程序了。此时就需要我们的VC++ 6.0来编译此程序,编译无错误才运行此程序,编译按钮和运行按钮如下图的红色箭头处:2、或者可以点击组建工具栏下的编译菜单项,然后再点击执行菜单项,也有快捷键,按Ctrl+F7编译...
大家正在搜
hello world代码c语言
c语言输出helloworld
用c语言写helloword
程序编写输出helloworld
c语言helloworld编程
c语言的hello world
编程helloworld代码
c++hello world代码
怎么编译helloworld程序
相关问题
hello world 用C语言怎么编写
如何用C语言编程实现输出6次的hello world语句?
如何在用C语言实现输出“hello world“
如何用C语言表达出hello world?
C语言。在屏幕上输出hello word
c语言hello world代码详细解释
用C语言代码怎么解释“Hello,world”?
用C语言代码怎么解释“Hello,world”?