| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1453 人关注过本帖
标题:一个究极新手问题,求帮助
只看楼主 加入收藏
wure
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2018-10-21
结帖率:50%
收藏
已结贴  问题点数:10 回复次数:6 
一个究极新手问题,求帮助
Description
This is the first problem for test. Since all we know the ASCII code, your job is simple: Input numbers and output corresponding messages.
Input
The input will contain a list of positive integers separated by whitespaces(spaces, newlines, TABs). Please process to the end of file (EOF). The integers will be no less than 32.
Output
Output the corresponding message. Note there is NOT a newline character in the end of output.
Sample Input
72 101 108 108 111 44
32 119 111 114 108 100 33
Sample Output
Hello, world!
搜索更多相关主题的帖子: the Input output end Sample 
2018-10-21 19:52
幻紫灵心
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:山咔咔里面
等 级:贵宾
威 望:53
帖 子:395
专家分:2640
注 册:2018-3-30
收藏
得分:10 
你有尝试过吗?

saber,别哭.
2018-10-21 20:52
wure
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2018-10-21
收藏
得分:0 
回复 2楼 幻紫灵心
我想用数组,但是到第二行的时候需要换个行,不知道该怎么办了
2018-10-21 21:23
幻紫灵心
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:山咔咔里面
等 级:贵宾
威 望:53
帖 子:395
专家分:2640
注 册:2018-3-30
收藏
得分:0 
程序代码:
#include <stdio.h>
int main()
{
    int ch;
    while(~scanf("%d",&ch))  {
        printf("%c",ch);
    }
    return 0;
}

换行不需要管它。

saber,别哭.
2018-10-21 21:32
wure
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2018-10-21
收藏
得分:0 
#include<stdio.h>
#include<string.h>
int main()
{   
    char a[100],b[100],i,u;      
    scanf("%d",&a[i]);   
    getchar();
    fflush(stdin);
    scanf("%d",&b[u]);
    for(i=0;i<strlen(a);i++)
        printf("%c",a[i]);
    for(u=0;u<strlen(b);u++)
        printf("%c",b[u]);
    return 0;
}
这样的话为啥结果只有个H
= =!
2018-10-21 21:38
wure
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2018-10-21
收藏
得分:0 
回复 4楼 幻紫灵心
程序代码:
#include<stdio.h>
#include<string.h>
int main()
{    
    char a[100],b[100],i,u;       
    scanf("%d",&a[i]);   
    getchar();
    fflush(stdin);
    scanf("%d",&b[u]);
    for(i=0;i<strlen(a);i++)
        printf("%c",a[i]);
    for(u=0;u<strlen(b);u++)
        printf("%c",b[u]); 
    return 0;

这样的话为啥结果只有个H
= =!
2018-10-21 21:49
幻紫灵心
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:山咔咔里面
等 级:贵宾
威 望:53
帖 子:395
专家分:2640
注 册:2018-3-30
收藏
得分:0 
没怎么懂你写的代码,
但是,清除缓冲区之后就没有读入了。

saber,别哭.
2018-10-21 22:53
快速回复:一个究极新手问题,求帮助
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018897 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved