题解 | 复读机

复读机

https://www.nowcoder.com/practice/9d381551b6ab40c4b5c3c8d60fe4066e

#include <stdio.h>

int main() 
{
int a;
long long b;
double c;
char d;
char e[1000];
scanf("%d", &a);
scanf("%lld", &b);
scanf("%lf", &c);
scanf(" %c", &d);
scanf("%999s", e);
     printf("%d\n",a);
     printf("%lld\n",b);
     printf("%.1lf\n",c);
     printf("%c\n",d);
     printf("%s\n",e);

    return 0;
}

谁懂啊,1.范围是用longlong的,类型是用lld的

2.字符和字符串都对应char

3.字符用c,字符串用s

4.char要是不改的话只能容纳1个,所以要写char e[1000];

scanf("%999s", e);

printf("%s\n",e);

5.scanf(" %c", &d);一定要注意%c前面的空格

全部评论
太棒了,小宝
点赞 回复 分享
发布于 10-16 15:27 重庆

相关推荐

嵌入式的小白:简历关键的就是项目经历,你这密密麻麻的,我一点开就不想看了,每一条都不换行,而且每一个里面写那么多,需要精简一下,这样别人看一眼就能知道你做了啥,用了啥技术
点赞 评论 收藏
分享
评论
3
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务